title: Exception handling with dynamic mixins in Grails controller
body: <p>I am using dynamic mixins on my Grails 2.3.11 controllers <a href="https://stackoverflow.com/a/22817283">according to this proposal on SO</a>, for DRY reasons:</p>
  
  <pre><code>class SomeApiController {
      def SomeApiController() {
          SomeApiController.mixin MyControllerMixin
      }
      ...
  </code></pre>
  
  <p>Unfortunately it does not work for exception handlers, like:</p>
  
  <pre><code>class MyControllerMixin {
      ...
      def businessException( BusinessException e ) {
          log.error( "API exception: ${e.message} ${e.errorCode}", e )
          def result = [
              status: 'Failure',
              errorCode: e.errorCode.name()
          ]
          response.status = 400
          render result as JSON
      }
      ...
  }
  </code></pre>
  
  <p>In this case, the default exception handler in <code>SomeApiController</code> is called when a <code>BusinessException</code> is thrown from somewhere. It works nicely if I place the handler directly in the controller, though, but this is what I want to avoid obviously.</p>
  
  <p>Is there any workaround to get that working as well?</p>