Exemplo n.º 1
0
 public function register()
 {
     $app = $this->app;
     // set debug mode as false, otherwise Slim will handle exceptions with default error handler
     $app->config('debug', false);
     $app->error(function (\Exception $e) use($app) {
         error_log('ERROR Code: ' . $e->getCode());
         error_log('ERROR Message: ' . $e->getMessage());
         error_log('ERROR Trace: ' . $e->getTraceAsString());
         echo \FindSite\Infrastructure\Helper\ResponseHelper::json($app, '', 200, $e->getCode(), $e->getMessage(), $e->getTraceAsString());
     });
 }
Exemplo n.º 2
0
 protected function success()
 {
     echo \FindSite\Infrastructure\Helper\ResponseHelper::json($this->app, $message = 'success');
 }