+ public function handleError($e)
+ {
+ if ($e instanceof ClientException) {
+ $this->clientError($e->getMessage(), $e->getCode());
+ } elseif ($e instanceof ServerException) {
+ $this->serverError($e->getMessage(), $e->getCode());
+ } else {
+ // If it wasn't specified more closely which kind of exception it was
+ $this->serverError($e->getMessage(), 500);
+ }
+ }
+