Add console rendering for nami exception

This commit is contained in:
philipp lang 2022-02-19 22:49:30 +01:00
parent ff82886738
commit 423fb27f51
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@
namespace Zoomyboy\LaravelNami; namespace Zoomyboy\LaravelNami;
use Illuminate\Console\Command;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
@ -48,4 +49,11 @@ class NamiException extends \Exception {
throw ValidationException::withMessages(['id' => 'Unbekannter Fehler']); 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());
}
} }