Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Added 'throwIf' method to PendingRequest #42260

Merged
merged 1 commit into from
May 4, 2022

Conversation

denniseilander
Copy link
Contributor

@denniseilander denniseilander commented May 4, 2022

In addition to this PR which allows adding the throw method to the PendingRequest, this PR adds the throwIf method to throw the exception if the condition evaluates to true.

// Throws RequestException
return Http::baseUrl('https://foo.bar')
       ->throwIf(true)
       ->get('not-found');
// Doesn't throw
return Http::baseUrl('https://foo.bar')
       ->throwIf(false)
       ->get('not-found');

@taylorotwell taylorotwell merged commit 347b9e1 into laravel:9.x May 4, 2022
@denniseilander denniseilander deleted the patch-1 branch May 4, 2022 20:48
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.

2 participants