Here you can find the source of exception_details(Exception e)
Parameter | Description |
---|---|
e | a parameter |
public static String exception_details(Exception e)
//package com.java2s; /*/*from w ww . java2 s .c o m*/ * This code is subject to the HIEOS License, Version 1.0 * * Copyright(c) 2008-2009 Vangent, Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * * @param e * @return */ public static String exception_details(Exception e) { /* ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); e.printStackTrace(ps); */ e.printStackTrace(); return "Exception thrown: " + e.getClass().getName() + " : " + e.getMessage(); //return "Exception thrown: " + e.getClass().getName() + "\n" + e.getMessage() + "\n" + new String(baos.toByteArray()); } }