Skip to content

Commit

Permalink
Added simplifying API getAsStringLocaleIndepdent ()
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Feb 14, 2024
1 parent 5730b50 commit b8de226
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ph-commons/src/main/java/com/helger/commons/error/IError.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,31 @@ default Throwable getLinkedExceptionCause ()
* @param aContentLocale
* Locale to resolve the error text
* @return The default string representation
* @see ErrorTextProvider#DEFAULT
* @see #getAsStringLocaleIndepdent()
*/
@Nonnull
@Nonempty
default String getAsString (@Nonnull final Locale aContentLocale)
{
return ErrorTextProvider.DEFAULT.getErrorText (this, aContentLocale);
}

/**
* Get the error as a string representation, including error ID, error
* location, error text and the linked exception.
*
* @param aContentLocale
* Locale to resolve the error text
* @return The default string representation
* @see ErrorTextProvider#DEFAULT
* @see #getAsString(Locale)
* @since 11.1.4
*/
@Nonnull
@Nonempty
default String getAsStringLocaleIndepdent ()
{
return getAsString (Locale.ROOT);
}
}

0 comments on commit b8de226

Please sign in to comment.