Used try and restore application state when things go wrong. This is called by AbstractAction to try and recover when sending out a ServiceException.
Allows a Response a chance to clean up after its self when AbstractionAction is error handling.
449450451452453454455456457458459
serviceResponse.execute(serviceRequest); LOGGER.finer("execution succeed"); } catch (ServiceException serviceException) { LOGGER.warning("service exception while executing request: " + serviceRequest + "\ncause: " + serviceException.getMessage()); serviceResponse.abort(s); sendError(response, serviceException); return; } catch (Throwable t) { //we can safelly send errors here, since we have not touched response yet
455456457458459460461462463464465
sendError(response, serviceException); return; } catch (Throwable t) { //we can safelly send errors here, since we have not touched response yet serviceResponse.abort(s); sendError(response, t); return; }
491492493494495496497498499500501
// Apparently this is a "cancel" and will quietly go away // // I will still give strategy and serviceResponse // a chance to clean up // serviceResponse.abort(s); strategy.abort(); return; } catch (IOException ex) { serviceResponse.abort(s);
496497498499500501502503504505506
serviceResponse.abort(s); strategy.abort(); return; } catch (IOException ex) { serviceResponse.abort(s); strategy.abort(); sendError(response, ex); return; }
509510511512513514515516517518519
// gather response serviceResponse.writeTo(strategyOuput); strategyOuput.flush(); strategy.flush(); } catch (java.net.SocketException sockEx) { // user cancel serviceResponse.abort(s); strategy.abort(); return; } catch (IOException ioException) { // strategyOutput error serviceResponse.abort(s);
514515516517518519520521522523524
serviceResponse.abort(s); strategy.abort(); return; } catch (IOException ioException) { // strategyOutput error serviceResponse.abort(s); strategy.abort(); sendError(response, ioException); return; } catch (ServiceException writeToFailure) { // writeTo Failure
520521522523524525526527528529530
strategy.abort(); sendError(response, ioException); return; } catch (ServiceException writeToFailure) { // writeTo Failure serviceResponse.abort(s); strategy.abort(); sendError(response, writeToFailure); return; } catch (Throwable help) { // This is an unexpected error(!)
527528529530531532533534535536537
sendError(response, writeToFailure); return; } catch (Throwable help) { // This is an unexpected error(!) help.printStackTrace(); serviceResponse.abort(s); strategy.abort(); sendError(response, help); return; }