protected ResponseBean getExceptionAsResponseBean(ActionInvocation invocation, Exception ex) {
if (ex instanceof NoSuchStopServiceException
|| ex instanceof NoSuchTripServiceException
|| ex instanceof NoSuchRouteServiceException) {
return new ResponseBean(V1, ResponseCodes.RESPONSE_RESOURCE_NOT_FOUND,
ex.getMessage(), null);
}
else if( ex instanceof OutOfServiceAreaServiceException) {
return new ResponseBean(V1, ResponseCodes.RESPONSE_OUT_OF_SERVICE_AREA,
ex.getMessage(), null);
}
else {
String url = getActionAsUrl(invocation);
_log.warn("exception for action: url=" + url, ex);
return new ResponseBean(V1, ResponseCodes.RESPONSE_SERVICE_EXCEPTION,
ex.getMessage(), null);
}
}