-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat: double default truncateAt for guzzle error output #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for a quick fix!
$stack = null; | ||
if (class_exists(BodySummarizer::class)) { | ||
// double the # of characters before truncation by default | ||
$bodySummarizer = new BodySummarizer(240); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be made configurable somehow? Is there already a way to configure things in this package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible for the end user to pass in custom guzzle clients like this:
$http = new GuzzleHttp\Client($someCustomConfig);
$assetClient = new AssetServiceGapicClient([
'credentialsConfig' => [
'authHttpHandler' => $http, // for calls made to the token endpoint
],
'rest' => [
'httpHandler' => $http, // for calls made to the API using REST
]
]);
However, this change is to modify the default value, so we're just hardcoding it.
Guzzle 7 Only
This will help the user receive a more helpful error message when encountering Google API exceptions. For example, with the "reAuth" error:
Before
After