Sometimes, understand why an exception has been thrown from the http status code is not enough.
We could handle the cases using a specific error code.
Error codes naming proposals:
I would prefer to use the second option, where 0 is always the blocking error code that sets the error layout.
@batopa @stefanorosanelli @fquffio
What are your opinions?
Uhm... maybe to have a unique error code is better to know always what kind of error was thrown. The HTTP status code could help to know what operation was been tried.
For example if error code 10 means "Missing object related" you know that when server responds with that code the error is always the same. The HTTP status instead will give information depending from request type for eample a 404 if a GET operation was done or 500 if a POST operation was done.
#719 feat: introduce internal error codes
#719 chore: more explicit error code sting
#719 feat: UPLOAD_MAX_FILESIZE_EXCEEDED added
#719 feat: add class to handle error code
It makes throw exception with error code more flexible
#719 chore: fix some passed parameter
#719 feat: ApiUpload uses new error code info
#719 test: add basic unit test of BeErrorCode
#719 fix: PHP 5.3 compatibility
#719 fix: PHP 5.3 compat - array