Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit-CloudSufi committed Jan 23, 2025
1 parent 875e48f commit bc96350
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,25 @@ public ProgramFailureException getExceptionDetails(Exception e, ErrorContext err
return null;
}
if (t instanceof IllegalArgumentException) {
return getProgramFailureException((IllegalArgumentException) t, errorContext, ErrorType.USER);
return getProgramFailureException((IllegalArgumentException) t, errorContext,
ErrorType.USER);
}
}
return null;
}

/**
* Get a ProgramFailureException with the given error
* information from {@link Exception}.
* Get a ProgramFailureException with the given error information from {@link Exception}.
*
* @param exception The Exception to get the error information from.
* @return A ProgramFailureException with the given error information.
*/
private ProgramFailureException getProgramFailureException(Exception exception, ErrorContext errorContext,
ErrorType errorType) {
private ProgramFailureException getProgramFailureException(IllegalArgumentException exception,
ErrorContext errorContext, ErrorType errorType) {
String errorMessage = exception.getMessage();
return ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN),
errorMessage,
String.format(ERROR_MESSAGE_FORMAT, errorContext.getPhase(), errorMessage), errorType, false, exception);
return ErrorUtils.getProgramFailureException(
new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), errorMessage,
String.format(ERROR_MESSAGE_FORMAT, errorContext.getPhase(), errorMessage), errorType,
false, exception);
}
}

0 comments on commit bc96350

Please sign in to comment.