Package org.seedstack.seed.spi
Interface SeedExceptionTranslator
-
public interface SeedExceptionTranslatorThis interface can be implemented to provide an exception translator, capable of translating specific exceptions to aBaseException. Implementations must be declared as aServiceLoaderservice in META-INF/services to be detected.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanTranslate(Exception e)Check if the specified exception can be translated.org.seedstack.shed.exception.BaseExceptiontranslate(Exception e)Translate the specified exception.
-
-
-
Method Detail
-
canTranslate
boolean canTranslate(Exception e)
Check if the specified exception can be translated.- Parameters:
e- The candidate exception.- Returns:
- true if this translator can translate it, false otherwise.
-
translate
org.seedstack.shed.exception.BaseException translate(Exception e)
Translate the specified exception. It is strongly recommended to put the original exception as the cause of the translated one.- Parameters:
e- The exception to translate.- Returns:
- the translated exception.
-
-