Package com.helger.commons.error
Interface IError
- All Superinterfaces:
IErrorIndicator,IGenericImplTrait<IError>,IHasErrorField,IHasErrorID,IHasErrorLevel,IHasErrorLevelComparable<IError>,ISeverityComparable<IError>,ISuccessIndicator
- All Known Implementing Classes:
SingleError
@MustImplementEqualsAndHashcode
public interface IError
extends IHasErrorLevelComparable<IError>, IHasErrorID, IHasErrorField
Common interface for single errors and resource errors.
- Since:
- 8.5.0
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetAsString(Locale aContentLocale) Get the error as a string representation, including error ID, error location, error text and the linked exception.default StringGet the error as a string representation, including error ID, error location, error text and the linked exception.default LocalDateTimedefault Stringdefault Stringdefault ILocationdefault StringgetErrorText(Locale aContentLocale) Get the error message of this error.default IHasErrorTextdefault Throwabledefault Throwabledefault Stringdefault StackTraceElement[]default booleanCheck if a error date time is present.default booleanCheck if a reasonable error location is present.default booleanMethods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsTMethods inherited from interface com.helger.commons.error.IHasErrorField
hasErrorFieldName, hasErrorFieldName, hasNoErrorFieldNameMethods inherited from interface com.helger.commons.error.IHasErrorID
hasErrorID, hasErrorID, hasNoErrorIDMethods inherited from interface com.helger.commons.error.level.IHasErrorLevel
getErrorLevel, hasErrorLevel, isError, isFailure, isNoError, isSuccessMethods inherited from interface com.helger.commons.error.level.IHasErrorLevelComparable
compareTo, isEQ, isGE, isGT, isLE, isLT, isNEMethods inherited from interface com.helger.commons.state.ISuccessIndicator
and, or
-
Method Details
-
getErrorDateTime
- Returns:
- The date and time when the error occurred. Defaults to
nullfor backwards compatibility. - Since:
- 10.1.7
-
hasErrorDateTime
default boolean hasErrorDateTime()Check if a error date time is present.- Returns:
trueif error date time information is present,falseotherwise.- Since:
- 10.1.7
- See Also:
-
getErrorID
- Specified by:
getErrorIDin interfaceIHasErrorID- Returns:
- The error ID. May be
null.
-
getErrorFieldName
- Specified by:
getErrorFieldNamein interfaceIHasErrorField- Returns:
- The field for which the error occurred. May be
null.
-
getErrorLocation
- Returns:
- The non-
nulllocation of the error. UseSimpleLocation.NO_LOCATIONto indicate no location is available. - See Also:
-
hasErrorLocation
default boolean hasErrorLocation()Check if a reasonable error location is present.- Returns:
trueif location information is present,falseotherwise.- See Also:
-
getErrorTexts
- Returns:
- The contained error message text. May be
null. - See Also:
-
getErrorText
Get the error message of this error.- Parameters:
aContentLocale- The locale to be used in case the error text is available in multiple languages.- Returns:
- The message of this form error. May be
nullin case no error text is available or if the passed Locale is not supported. - See Also:
-
getLinkedException
- Returns:
- The linked exception or
nullif no such exception is available. - See Also:
-
hasLinkedException
default boolean hasLinkedException()- Returns:
trueif a linked exception is present,falseif not.- See Also:
-
getLinkedExceptionMessage
- Returns:
- The message of the linked exception or
nullif no such exception is available. - See Also:
-
getLinkedExceptionStackTrace
- Returns:
- The stack trace of the linked exception or
nullif no such exception is available. - See Also:
-
getLinkedExceptionCause
- Returns:
- The cause of the linked exception or
nullif no such exception is available. - See Also:
-
getAsString
Get the error as a string representation, including error ID, error location, error text and the linked exception.- Parameters:
aContentLocale- Locale to resolve the error text- Returns:
- The default string representation
- See Also:
-
getAsStringLocaleIndepdent
Get the error as a string representation, including error ID, error location, error text and the linked exception.- Returns:
- The default string representation in the default locale.
- Since:
- 11.1.4
- See Also:
-