edburns%acm.org 991374db16 bug=80906
ra=edburns
author=  Nikolay Igotti

Added and removed files - continued previous checkin.


git-svn-id: svn://10.0.0.236/trunk@99136 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 20:26:30 +00:00

46 lines
1.3 KiB
Java

/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is The Waterfall Java Plugin Module
*
* The Initial Developer of the Original Code is Sun Microsystems Inc
* Portions created by Sun Microsystems Inc are Copyright (C) 2001
* All Rights Reserved.
*
* $Id: JSUtil.java,v 1.1 2001-07-12 20:25:46 edburns%acm.org Exp $
*
* Contributor(s):
*
* Nikolay N. Igotti <nikolay.igotti@Sun.Com>
*/
package netscape.javascript;
import java.io.*;
public class JSUtil {
/* Return the stack trace of an exception or error as a String */
public static String getStackTrace(Throwable t) {
ByteArrayOutputStream captureStream;
PrintWriter p;
captureStream = new ByteArrayOutputStream();
p = new PrintWriter(captureStream);
t.printStackTrace(p);
p.flush();
return captureStream.toString();
}
}