You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a hard time understanding how to make it work properly.
Quote from docs:
By default, RequestException messages are truncated to 120 characters when logged or reported. To customize or disable this behavior, you may utilize the truncateRequestExceptionsAt and dontTruncateRequestExceptions methods when configuring your application's exception handling behavior in your bootstrap/app.php file:
In the example above, execution will happen in the following order:
App bootstrap
\Illuminate\Foundation\Configuration\ApplicationBuilder::withExceptions() which stores a callable that will be executed after resolving \Illuminate\Foundation\Exceptions\Handler
Route execution
Request to 3rd party API
\Illuminate\Http\Client\Response::throw()
\Illuminate\Http\Client\Response::toException()
\Illuminate\Http\Client\RequestException::prepareMessage() <--- truncates response body
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a hard time understanding how to make it work properly.
Quote from docs:
bootstrap/app.php
routes/web.php
Result
In the example above, execution will happen in the following order:
\Illuminate\Foundation\Configuration\ApplicationBuilder::withExceptions()which stores a callable that will be executed after resolving\Illuminate\Foundation\Exceptions\Handler\Illuminate\Http\Client\Response::throw()\Illuminate\Http\Client\Response::toException()\Illuminate\Http\Client\RequestException::prepareMessage()<--- truncates response body\Illuminate\Foundation\Exceptions\Handler::__construct()\Illuminate\Foundation\Exceptions\Handler(callable passed toApplicationBuilder::withExceptions())\Illuminate\Foundation\Configuration\Exceptions::dontTruncateRequestExceptions()<--- configuration forRequestExceptionto not truncate response bodyWhat is the point of that configuration if that call will happen only after the response has already been truncated?
Am I missing how to use it correctly?
Beta Was this translation helpful? Give feedback.
All reactions