Skip to content

Record errors when using the deferred or background queue drivers - #686

Merged
duncanmcclean merged 1 commit into
7.xfrom
record-errors-on-deferred-queues
Oct 1, 2026
Merged

duncanmcclean merged 1 commit into
7.xfrom
record-errors-on-deferred-queues

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

This pull request fixes an issue where 404 errors weren't being recorded when using the deferred or background queue drivers.

This was happening because both drivers run jobs via Laravel's defer() helper, and deferred callbacks are only invoked when the response is successful (status code < 400). Since RecordError is dispatched while rendering a 404, the job was silently dropped every time.

This PR fixes it by dispatching the RecordError job after the response when using either of those drivers, so it's run in a terminating callback regardless of the response's status code.

Fixes #685

@duncanmcclean
duncanmcclean merged commit f3f123f into 7.x Oct 1, 2026
17 checks passed
@duncanmcclean
duncanmcclean deleted the record-errors-on-deferred-queues branch October 1, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error tracking records nothing when the queue connection is "background" or "deferred"

1 participant