code: function JsonResponseHandler(onlyForAjaxOrJsonRequests, returnFrames, sendResponse) {
      JsonResponseHandler.super_.call(this);
  
      /**
       * Should Ouch push output directly to the client?
       * If this is false, output will be passed to the callback
       * provided to the handle method.
       *
       * @type {boolean}
       * @protected
       */
      this.__sendResponse = sendResponse === undefined ? true : Boolean(sendResponse);
  
      /**
       * @var {boolean}
       * @protected
       */
      this.__returnFrames = returnFrames ? Boolean(returnFrames) : false;
  
      /**
       * If this is true handler will process this error if and only
       * if request is ajax or request accepts json.
       *
       * @var {boolean}
       * @protected
       */
      this.__onlyForAjaxOrJsonRequests = onlyForAjaxOrJsonRequests ? Boolean(onlyForAjaxOrJsonRequests) : false;
  }
docs: Catches an exception and converts it to a JSON
  response. Additionally can also return exception
  frames for consumption by an API.