Skip to content

Commit

Permalink
staging Throw error on purpose after saving event data
Browse files Browse the repository at this point in the history
  • Loading branch information
latheesan-k committed Nov 22, 2024
1 parent a44ceca commit ef9cebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions application/app/Http/Controllers/API/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ public function store(Request $request): Response
'data' => json_encode($validated['data']),
]);
// TODO dispatch(new ProcessEventDataJob($eventData));
// Intentionally throw error after saving
} catch (UniqueConstraintViolationException) {}

throw new \Exception('Test error');

return response()->noContent(200);
}
}
6 changes: 3 additions & 3 deletions application/bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
// Handle API Unhandled Exception
$exceptions->render(function (Throwable $e, Request $request) {
if ($request->is('api/*')) {
if (app()->environment('local')) {
dd($e);
}
// if (app()->environment('local')) {
// dd($e);
// }
Log::error(sprintf('Unhandled API Exception: %s %s', strtoupper($request->method()), $request->url()), [
'message' => $e->getMessage(),
'file' => $e->getFile(),
Expand Down

0 comments on commit ef9cebc

Please sign in to comment.