use of org.sklsft.commons.api.exception.TechnicalError in project skeleton-commons by skeleton-software-community.
the class ErrorReportHandler method convertErrorReport.
/**
* instantiates the {@link ApplicationException} as described in the {@link ErrorReport} that a rest service can respond
* @param errorReport
*/
public void convertErrorReport(ErrorReport errorReport) {
ApplicationException exception;
try {
exception = (ApplicationException) Class.forName(errorReport.getExceptionClassName()).newInstance();
exception.setMessage(errorReport.getMessage());
exception.setDetails(errorReport.getDetails());
} catch (Exception e) {
exception = new TechnicalError(ApplicationException.ERROR_UNKNOWN, e);
}
throw exception;
}
Aggregations