]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/ExceptionUtils.java
Minor fix and optimization for exporting TG and Pgraph with sharedlib
[simantics/platform.git] / bundles / org.simantics.db.testing / src / org / simantics / db / testing / common / ExceptionUtils.java
1 package org.simantics.db.testing.common;
2 /*******************************************************************************
3  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4  * in Industry THTH ry.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  *     VTT Technical Research Centre of Finland - initial API and implementation
12  *******************************************************************************/
13
14
15 import java.io.PrintWriter;
16 import java.io.StringWriter;
17
18 public class ExceptionUtils {
19
20         public static String getStackTrace(Throwable e) {
21                 
22                 StringWriter w = new StringWriter();
23                 PrintWriter pw = new PrintWriter(w);
24                 e.printStackTrace(pw);
25                 return w.toString();
26         }
27 }