Skip to content

Commit

Permalink
fix: set status, error or falut, after response (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan361425 authored Sep 10, 2021
1 parent 9bf25b8 commit 538aa07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Collectors/SegmentCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ public function submitHttpTracer($response): void
if (app()->bound(Auth::class) && Auth::check()) {
$tracer->setUser((string) Auth::user()->getAuthIdentifier());
}

$statusCode = $response->getStatusCode();
$tracer->end()
->setResponseCode($response->getStatusCode())
->setResponseCode($statusCode)
->setError($statusCode >= 400 && $statusCode < 500)
->setFault($statusCode >= 500 && $statusCode < 600)
->submit(new $submitterClass());
}

Expand Down

0 comments on commit 538aa07

Please sign in to comment.