For exception handling I plan to use this approach
- Create your own Exception handler with Exception.handler or this one:
- Using a custom renderer with Exception.renderer to handle application exceptions
1) Can you mention about the differences between them? Cookbook tells the difference with this sentence
"If you don’t want to take control of the exception handling, but want to change how exceptions are rendered..."
2) I'm planning to add 503 Service Unavailable code as an exception. But How can I implement this error?
Cookbook has such an example for missingWidget, how can I change it for 503 service not available?
class AppExceptionRenderer extends ExceptionRenderer {
public function missingWidget($error) {
echo 'Oops that widget is missing!';
}
}