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

More useful error messages #1861

tomslominski opened this Issue Mar 8, 2015 · 0 comments


None yet
2 participants

Hi. I've noticed that the public page in the master branch right now returns $status and $message variables which provide information about whether the shortening has succeeded or not. That's great, but in practise, for me anyway, it's not that useful. For example, when you successfully shorten a new URL, you get something like string(7) "success" string(45) " added to database".

However, if you submit an existing long URL, you get something like string(4) "fail" string(51) " already exists in database". Depending on how you look at it, that could be a success, as a short URL for that particular long URL is available.

I think it would be more useful if a wider variety of errors was introduced (such as 'exists' for the above error, as it's not really a success nor a fail).

Furthermore, not all errors seem to be handled this way. For example, if you submit too many URLs, this happens instead.

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