X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FGithub%2FException%2FRequestException.php;h=c0a3d33c71524b3438dc7528759460763d839c6d;hb=eb76e9bb9a39fe2725301f6cf6fc3cf29bbc4e00;hp=49ea1ae72f9a5db3fa805299cb48b732bfb886e9;hpb=beaa328995cb2a32871259978d8da4acb3dc7715;p=pharext%2Fpharext.org diff --git a/app/Github/Exception/RequestException.php b/app/Github/Exception/RequestException.php index 49ea1ae..c0a3d33 100644 --- a/app/Github/Exception/RequestException.php +++ b/app/Github/Exception/RequestException.php @@ -47,10 +47,15 @@ class RequestException extends \Exception implements Exception $errors = "JSON errors:\n"; foreach ($this->errors as $error) { - $errors .= sprintf($reasons[$error->code], $error->resource, $error->field); + if ($error->code === "custom") { + $errors .= $error->message . "\n"; + } else { + $errors .= sprintf($reasons[$error->code], $error->resource, $error->field); + } } return $errors; } + function __toString() { return parent::__toString() . "\n". $this->getErrorsAsString(); }