1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/you-can-make-the-http-client-throw-exceptions-to-terminate-execution-on-any-received-errors.md
2021-10-24 13:25:04 +02:00

17 lines
No EOL
718 B
Markdown

---
title: 'You can make the Http client throw exceptions to terminate execution on any received errors'
tweet_id: '1451526356521693187'
thread_slug: weekly-thread-2021-44
author_username: pascalbaljet
images:
- 'https://pbs.twimg.com/media/FCKQ8JdWUAc0I4q.jpg'
created_at: 2021-10-22T12:30:26+00:00
slug: you-can-make-the-http-client-throw-exceptions-to-terminate-execution-on-any-received-errors
---
💡 By default, the @laravelphp HTTP client doesn't throw exceptions on client and server errors.
However, you can make it do that by using the 'throw' method, and this method is chainable 🔥
Documentation: https://laravel.com/docs/8.x/http-client#throwing-exceptions
#Laravel #PHP #webdev #webdevelopment