Created
September 26, 2018 23:12
-
-
Save JamesTheHacker/fe00c5e7c86aa1e64572b3052caf19f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$container['errorHandler'] = function ($c) { | |
return function ($request, $response, $exception) use ($c) { | |
$c->logger->error('Application Error:', [$exception]); | |
return $c['response'] | |
->withStatus(500) | |
->withHeader('Content-Type', 'application/json') | |
->withJson([ | |
'success' => false, | |
'error' => "Nope, that didn't work. Try again." | |
]); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment