mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Add ReaderException.setStackTrace
This commit is contained in:
parent
ab23778d4b
commit
b30da44d01
|
@ -26,7 +26,7 @@ package com.google.zxing;
|
||||||
public abstract class ReaderException extends Exception {
|
public abstract class ReaderException extends Exception {
|
||||||
|
|
||||||
// disable stack traces when not running inside test units
|
// disable stack traces when not running inside test units
|
||||||
protected static final boolean isStackTrace =
|
protected static boolean isStackTrace =
|
||||||
System.getProperty("surefire.test.class.path") != null;
|
System.getProperty("surefire.test.class.path") != null;
|
||||||
protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0];
|
protected static final StackTraceElement[] NO_TRACE = new StackTraceElement[0];
|
||||||
|
|
||||||
|
@ -44,4 +44,15 @@ public abstract class ReaderException extends Exception {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For testing only. Controls whether library exception classes include stack traces or not.
|
||||||
|
* Defaults to false, unless running in the project's unit testing harness.
|
||||||
|
*
|
||||||
|
* @param enabled if true, enables stack traces in library exception classes
|
||||||
|
* @since 3.5.0
|
||||||
|
*/
|
||||||
|
public static void setStackTrace(boolean enabled) {
|
||||||
|
isStackTrace = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue