Skip to content

Ensure a failure in recording does not break the request - #23

Open
JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/recording-failure-does-not-break-the-request
Open

JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/recording-failure-does-not-break-the-request

Conversation

@JonPurvis

Copy link
Copy Markdown

Barstool records requests from inside Saloon's request, response, and fatal middleware. Those pipelines do not swallow exceptions, so a failure while writing a recording became the result of the API call.

If the insert failed for whatever reason, a successful response never reached the application. If it failed while recording a connection error, the database exception replaced the original connection error, therefore masking the actual error.

I've updated the middleware so now catches a recording failure and reports it. The API call continues with its original response/exception.

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.

1 participant