-
Notifications
You must be signed in to change notification settings - Fork 113
Intercept and customize error from Guzzle #226
Intercept and customize error from Guzzle #226
Conversation
6ef89ad
to
ef91ce2
Compare
$handler = Utils::getDefaultHandler(); | ||
} catch (\RuntimeException $e) { | ||
throw new \RuntimeException( | ||
'The symfony installer requires the php-curl extension or the ' |
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.
Symfony
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.
@xabbuh fixed
ef91ce2
to
8e51180
Compare
$handler = Utils::getDefaultHandler(); | ||
} catch (\RuntimeException $e) { | ||
throw new \RuntimeException( | ||
'The Symfony installer requires the php-curl extension or the ' |
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.
I don't think wrapping this message is the best idea for code style :)
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.
The linebreak? Removed it. It's < 120 characters wide. :)
8e51180
to
ea2c961
Compare
$handler = Utils::getDefaultHandler(); | ||
} catch (\RuntimeException $e) { | ||
throw new \RuntimeException( | ||
'The Symfony installer requires the php-curl extension or the allow_url_fopen ini setting.'); |
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 be on the next line, or keep everything inlined with the \RuntimeException
constructor call.
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.
fixed
ea2c961
to
3a5b5ca
Compare
WORKDIR /root/shared | ||
RUN apt-get update && apt-get install -y php5-cli | ||
|
||
ENTRYPOINT /bin/bash |
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.
Is this really needed to have a dockerfile in this repo actually?
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.
Wow. I can't do this right.... I accidentally committed it. Really sorry... Removed.
When guzzle is initalized it tried to find a suitable handler to use. If no handler can be found (for example curl) an exception is thrown. With this change we try to find the handler before creating the client so we can pass the handler to the client manually. Doing this, we are able to customize the error message to make it (potentially) less confusing for the users who might have no idea what guzzle is.
3a5b5ca
to
951732b
Compare
@emil-nasso I love it when an application displays meaningful error messages. Thanks for helping us improving the Installer error messages. |
This PR was merged into the 1.0-dev branch. Discussion ---------- Intercept and customize error from Guzzle When guzzle is initalized it tries to find a suitable handler to use. If no handler can be found (for example curl) an exception is thrown. With this change we try to find the handler before creating the client so that we can pass the handler to the client manually. Doing this, we are able to customize the error message to make it (potentially) less confusing for the users who might have no idea what guzzle is. The issue was found when looking at PR #200 Commits ------- 951732b Intercept and customize error from Guzzle When guzzle is initalized it tried to find a suitable handler to use. If no handler can be found (for example curl) an exception is thrown. With this change we try to find the handler before creating the client so we can pass the handler to the client manually. Doing this, we are able to customize the error message to make it (potentially) less confusing for the users who might have no idea what guzzle is.
When guzzle is initalized it tries to find a suitable handler to use. If no handler can be found (for example curl) an exception is thrown.
With this change we try to find the handler before creating the client so that we can pass the handler to the client manually.
Doing this, we are able to customize the error message to make it (potentially) less confusing for the users who might have no idea what guzzle is.
The issue was found when looking at PR #200