protected function jsonError(\Exception $obj_error, $int_code)
    {
        $arr_response = [
            'code' => $int_code,
            'msg' => ($obj_error instanceof \ErrorException ? 'Internal Error' : 'Exception')
        ];
        $str_log_message = get_class($obj_error) . ': ' . $obj_error->getMessage();
        if($this->bol_expose_errors) {
            $arr_response['detail'] = $str_log_message;
        }
        if($int_code < 400 || $int_code > 505) {
            $int_code = 500;
        }
        $this->sendResponse($arr_response, $int_code);
        $this->getLogger()->error("[JAPI] [{$int_code}] Error: {$str_log_message}");
    }
protected function jsonError(\Exception $obj_error, $int_code)
    {
        $arr_response = [
            'code' => $int_code,
            'msg' => ($obj_error instanceof \ErrorException ? 'Internal Error' : 'Exception')
        ];
        $str_log_message = get_class($obj_error) . ': ' . $obj_error->getMessage();
        if($this->bol_expose_errors) {
            $arr_response['detail'] = $str_log_message;
        }
        if($int_code < 400 || $int_code > 505) {
            $int_code = 500;
        }
        $this->sendResponse($arr_response, $int_code);
        $this->getLogger()->error("[JAPI] [{$int_code}] Error: {$str_log_message}");
    }
protected function jsonError ( \ Exception $ obj_error , $ int_code ) { $ arr_response = [ 'code' => $ int_code , 'msg' => ( $ obj_error instanceof \ ErrorException ? 'Internal Error' : 'Exception' ) ] ; $ str_log_message = get_class ( $ obj_error ) . ': ' . $ obj_error -> getMessage ( ) ; if ( $ this -> bol_expose_errors ) { $ arr_response [ 'detail' ] = $ str_log_message ; } if ( $ int_code < 400 || $ int_code > 505 ) { $ int_code = 500 ; } $ this -> sendResponse ( $ arr_response , $ int_code ) ; $ this -> getLogger ( ) -> error ( "[JAPI] [{$int_code}] Error: {$str_log_message}" ) ; }
Whatever went wrong, let 'em have it in JSON over HTTP

@param \Exception $obj_error
@param int $int_code
Whatever went wrong let em have it in JSON over HTTP