View difference between Paste ID: eevJTshS and iTwEsHqw
SHOW: | | - or go back to the newest paste.
1
2
public String execute()
3
throws Exception {
4-
  try {
4+
  if(UserSecurityContext.hasPermission("SOME_AUTHORIZATION")) {
5-
    service.callSomething();
5+
    try {
6-
    return SUCCESS;
6+
      service.callSomething();
7
      return SUCCESS;
8-
  catch(ExceptionType1 e) {
8+
    }
9-
    addActionError("error.this.blew.up");
9+
    catch(SomeReallyBadUnExpectedException e) {
10
      e.printStackTrace();
11
      throw new RuntimeException(e);
12-
  catch(ExceptionType2 e) {
12+
    }
13-
    addFieldError("username", "error.username.criteria.not.met");
13+
14
  else {
15
    addActionError("error.permission.denied");
16
    return INPUT;
17
  }
18
}