Skip to content

Working around Guzzle's truncated debug output #47773

Answered by Angel5a
Synchro asked this question in Q&A
Discussion options

You must be logged in to vote

What I was expecting is for Laravel's wrapper to catch a guzzle exception, then transform and rethrow it using its own exception class. No such luck. It's also too late at that point as the message is already truncated by then.

Your assumption is wrong. You have full body response even after exception have been thrown.

Route::get('/',  fn () => response('DEBUG FAIL!' . str_repeat('0123456789', 100) , 503));
 Http::get('http://localhost/')->throw()->text();

   Illuminate\Http\Client\RequestException  HTTP request returned status code 503:
DEBUG FAIL!0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 (truncated...).

> Http::get…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@Synchro
Comment options

@Angel5a
Comment options

@Synchro
Comment options

@Angel5a
Comment options

Answer selected by Synchro
@Synchro
Comment options

@Angel5a
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants