Skip to content
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

Bad error message when photo ID is missing #83

Open
winternet-studio opened this issue Jan 26, 2018 · 1 comment
Open

Bad error message when photo ID is missing #83

winternet-studio opened this issue Jan 26, 2018 · 1 comment

Comments

@winternet-studio
Copy link

If you do the following code:

$photo = \Crew\Unsplash\Photo::find(null);
$download_url = $photo->download();

This is of course a bad ID argument for the find() method but I did this by mistake and it took a while before I realized the issue because the only error message I got was this:

EXCEPTION

[]

File: .../vendor/crewlabs/unsplash/src/Endpoint.php
Line: 87
#0 .../vendor/crewlabs/unsplash/src/Photo.php(208): Crew\Unsplash\Endpoint::__callStatic('get', Array)
#1 .../models/Unsplash.php(88): Crew\Unsplash\Photo->download()

Would be nice if this could be caught and notified clearly.

@lukechesser
Copy link
Member

@winternet-studio good point. Agree that we should catch that behaviour early and throw a more helpful error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants