Skip to content

Commit

Permalink
Merge pull request #2 from Deveodk/fixes
Browse files Browse the repository at this point in the history
Fix: Fixed exception on non handled exception, and updated reporter l…
  • Loading branch information
jasonkellydk authored Jan 20, 2018
2 parents b1360d2 + 95799a5 commit 9e9da19
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Exceptions/BaseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,13 @@ private function parseCoreExceptionCode()

$errorCodes = $config['error_codes'];

return $this->findExceptionCode($errorCodes);
$code = $this->findExceptionCode($errorCodes);

if ($code === null) {
return 0;
}

return $code;
}

/**
Expand Down Expand Up @@ -268,9 +274,9 @@ public function setStatusCode(int $statusCode)
}

/**
* @return string
* @return string|null
*/
public function getCoreExceptionCode(): string
public function getCoreExceptionCode(): ?string
{
return $this->coreExceptionCode;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Handlers/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public function report(Exception $exception)
return parent::report($exception);
}

if (env('APP_DEBUG', false)) {
return null;
}

if (method_exists($exception, 'getSeverity')) {
$severity = $exception->getSeverity();
}
Expand Down

0 comments on commit 9e9da19

Please sign in to comment.