title: PreAuthorize error handling
body: <p>I'm using <code>Spring Oauth2</code> and <code>Spring Pre-post Annotations</code> With <code>Spring-boot</code></p>
  
  <p>I Have a service class <code>MyService</code>. one of <code>MyService</code> methods is:</p>
  
  <pre><code>@PreAuthorize("#id.equals(authentication.principal.id)")
  public SomeResponse getExampleResponse(String id){...}
  </code></pre>
  
  <p>can i control in some manner the json that is returned by the caller Controller?</p>
  
  <p>the json that is returned by default is: </p>
  
  <pre><code>{error : "access_denied" , error_message: ".."}
  </code></pre>
  
  <p>I Want to be able to control the <code>error_message</code> param. I'm looking for something similar to:</p>
  
  <pre><code>@PreAuthorize(value ="#id.equals(authentication.principal.id)", onError ="throw new SomeException("bad params")")
  public SomeResponse getExampleResponse(String id){...}
  </code></pre>
  
  <p>One way i thought of doing it is by Using <code>ExceptionHandler</code></p>
  
  <pre><code>@ExceptionHandler(AccessDeniedException.class)
  public Response handleAccessDeniedException(Exception ex, HttpServletRequest request){
      ...
  }
  </code></pre>
  
  <p>but i can't control the <code>message</code> of the exception. and also i can't be sure that this <code>Exception</code> will be thrown in future releases </p>