Revision 3067 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/exception/BaseException.java
BaseException.java | ||
---|---|---|
405 | 405 |
BaseException.translator = new TranslatorWraper(translator); |
406 | 406 |
} |
407 | 407 |
|
408 |
public static boolean containsCause(Throwable ex, Class<? extends Throwable> searchException) { |
|
409 |
if(searchException.isInstance(ex)){ |
|
410 |
return true; |
|
411 |
} |
|
412 |
BaseExceptionIterator it = new BaseExceptionIterator(ex); |
|
413 |
while (it.hasNext()) { |
|
414 |
if(searchException.isInstance(it.next())){ |
|
415 |
return true; |
|
416 |
} |
|
417 |
} |
|
418 |
return false; |
|
419 |
} |
|
420 |
|
|
408 | 421 |
} |
409 | 422 |
|
410 | 423 |
@SuppressWarnings("UseSpecificCatch") |
Also available in: Unified diff