From 423fb27f51e322b42fa3b2a01b1bafd886f514fe Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 19 Feb 2022 22:49:30 +0100 Subject: [PATCH] Add console rendering for nami exception --- src/NamiException.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NamiException.php b/src/NamiException.php index 30b44a2..21276a9 100644 --- a/src/NamiException.php +++ b/src/NamiException.php @@ -2,6 +2,7 @@ namespace Zoomyboy\LaravelNami; +use Illuminate\Console\Command; use Illuminate\Support\Str; use Illuminate\Validation\ValidationException; @@ -48,4 +49,11 @@ class NamiException extends \Exception { throw ValidationException::withMessages(['id' => 'Unbekannter Fehler']); } + + public function outputToConsole(Command $command): void + { + $command->info("Request URL: ".$this->requestUrl); + $command->info("response: ".json_encode($this->response)); + $command->info($this->getMessage()); + } }