use of com.thoughtworks.go.config.StageNotFoundException in project gocd by gocd.
the class StageController method handleError.
@ErrorHandler
public ModelAndView handleError(HttpServletRequest request, HttpServletResponse response, Exception e) {
Map<String, Object> json = new LinkedHashMap<>();
String message = e.getMessage();
if (e instanceof StageNotFoundException) {
StageNotFoundException stageNotFoundException = (StageNotFoundException) e;
message = format("Stage '%s' of pipeline '%s' does not exist in current configuration. You can not rerun it.", stageNotFoundException.getStageName(), stageNotFoundException.getPipelineName());
}
addFriendlyErrorMessage(json, message);
return jsonNotAcceptable(json).respond(response);
}
Aggregations