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

Errorcode in error data object #98

Open
bugada opened this issue Sep 13, 2015 · 4 comments
Open

Errorcode in error data object #98

bugada opened this issue Sep 13, 2015 · 4 comments
Assignees

Comments

@bugada
Copy link
Contributor

bugada commented Sep 13, 2015

Currently errors are handled returning an object with a boolean value 'error' and a string 'message'.
The message in case of generic error contains also an error code at the end.

I suggest adding to the object response a string 'code', unique for each error.
So one can override the message error or forward to a specific page.
Very useful also when using ajax.

@Conver
Copy link
Contributor

Conver commented Sep 13, 2015

Added to todo list https://github.com/PHPAuth/PHPAuth/wiki/Todo-list

@JacquesLoubser
Copy link
Contributor

Any formats that you want to follow? Or can I start at the top and define numbers?
Maybe codes like "PASS-01" or "PASS-INVALID" should be used.

@bugada
Copy link
Contributor Author

bugada commented Sep 13, 2015

Probably they should be numbers grouped by their family (system_error from 0 to 100, login errors from 101 to 200 and so on) like http error codes, but I am open to other solutions. The only requirement is they are unique IMHO.

@Conver
Copy link
Contributor

Conver commented Oct 2, 2020

status?

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

3 participants