Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

improve error messages when the download fails #59

Merged
merged 1 commit into from
Dec 2, 2014

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Nov 26, 2014

This pull request addresses #48.

try {
$response = $client->get($symfonyArchiveFile);
} catch (ClientException $e) {
if ($e->getCode() === 403 || $e->getCode() === 404) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for 403 can be removed once the download site returns proper error codes when a file could not be found.

} catch (ClientException $e) {
if ($e->getCode() === 403 || $e->getCode() === 404) {
throw new \RuntimeException(sprintf(
"The selected version (%s) cannot be installed because it does not exist. ".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I didn't see that this line doesn't contain a \n. Don't you think that the resulting error message would be too long? I love the way the message looks in the source code and I guess that it would be great to maintain that same format in the command console.

@xabbuh
Copy link
Member Author

xabbuh commented Dec 2, 2014

@javiereguiluz The line break makes sense. It now looks like this:

after

While before it has been:

before

@xabbuh
Copy link
Member Author

xabbuh commented Dec 2, 2014

However, I also decided to simply show "php symfony new project-name latest" as a suggestion instead of trying to build the original command since that's how it ends up for users if they follow the installation instructions.

@javiereguiluz
Copy link
Member

👍 everything looks good to me. Thanks @xabbuh!

@fabpot
Copy link
Member

fabpot commented Dec 2, 2014

Thank you @xabbuh.

@fabpot fabpot merged commit cadccd3 into symfony:master Dec 2, 2014
fabpot added a commit that referenced this pull request Dec 2, 2014
This PR was merged into the 1.0-dev branch.

Discussion
----------

improve error messages when the download fails

This pull request addresses #48.

Commits
-------

cadccd3 improve error messages when the download fails
@xabbuh xabbuh deleted the issue-48 branch December 2, 2014 21:23
fabpot added a commit that referenced this pull request Dec 4, 2014
This PR was merged into the 1.0-dev branch.

Discussion
----------

suggest to use symfony.phar on Windows

The command that is suggested since #59 when the download of a non-existent Symfony version fails, is not sufficient on Windows. We need to suggest `php symfony.phar ...` instead.

Commits
-------

6a7324d suggest to use symfony.phar on Windows
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants