1 23 24 package org.apache.slide.common; 25 26 import java.io.PrintWriter ; 27 import java.io.StringWriter ; 28 29 import org.apache.slide.common.Domain; 30 import org.apache.slide.util.logger.Logger; 31 32 33 38 public class SlideException extends Exception { 39 40 private static final String CHANNEL = "org.apache.slide.common.SlideException"; 41 private static final int DEBUG = Logger.DEBUG; 42 private static Logger LOGGER = Domain.getLogger(); 43 44 45 47 48 53 public SlideException(String message) { 54 this(message, true); 55 } 56 57 58 64 public SlideException(String message, boolean showTrace) { 65 super(message); 66 if (showTrace) { 67 Domain.warn(message); 68 } 69 70 if (LOGGER.isEnabled(CHANNEL, DEBUG)) { 71 StringWriter sw = new StringWriter (); 72 printStackTrace( new PrintWriter (sw, true) ); LOGGER.log( sw.toString(), CHANNEL, DEBUG ); 74 } 75 } 76 77 } 78 | Popular Tags |