original_string: protected function _throwException($exception = null)
      {
          if ($exception !== null) {
              if (!Configure::read('debug') && $exception instanceof SecurityException) {
                  $exception->setReason($exception->getMessage());
                  $exception->setMessage(self::DEFAULT_EXCEPTION_MESSAGE);
              }
              throw $exception;
          }
          throw new BadRequestException(self::DEFAULT_EXCEPTION_MESSAGE);
      }
code: protected function _throwException($exception = null)
      {
          if ($exception !== null) {
              if (!Configure::read('debug') && $exception instanceof SecurityException) {
                  $exception->setReason($exception->getMessage());
                  $exception->setMessage(self::DEFAULT_EXCEPTION_MESSAGE);
              }
              throw $exception;
          }
          throw new BadRequestException(self::DEFAULT_EXCEPTION_MESSAGE);
      }
code_tokens: protected function _throwException ( $ exception = null ) { if ( $ exception !== null ) { if ( ! Configure :: read ( 'debug' ) && $ exception instanceof SecurityException ) { $ exception -> setReason ( $ exception -> getMessage ( ) ) ; $ exception -> setMessage ( self :: DEFAULT_EXCEPTION_MESSAGE ) ; } throw $ exception ; } throw new BadRequestException ( self :: DEFAULT_EXCEPTION_MESSAGE ) ; }
docstring: Check debug status and throw an Exception based on the existing one
  
  @param \Cake\Controller\Exception\SecurityException|null $exception Additional debug info describing the cause
  @throws \Cake\Http\Exception\BadRequestException
  @return void
docstring_tokens: Check debug status and throw an Exception based on the existing one