AKSW / Erfurt

PHP5 / Zend based Semantic Web API for Social Semantic Software
41 stars 27 forks source link

Error Codes for Various Exceptions #132

Open shinobu opened 8 years ago

shinobu commented 8 years ago

This pull request adds error codes for all Exceptions except for NoViableAltException and EarlyExitException as those both are used only in the Sparql Parser (and I doubt messing with it would be a good idea)

I created the following Error Codes:

DEFAULT_ERROR for 0 as 0 is the default output from the getCode() function of Exceptions and the places where it appears most likely only wanted to use the third optional parameter for creating an Exception.

DATABASE_ERROR and PARSER_ERROR for -1 as all those files used that number as general exception for the class (most likely only to use the third optional parameter as well)

FILTER_ERROR for 1 for the same reason as DATABASE_ERROR and PARSER_ERROR

NO_ERROR for 20 as the Exceptions with this number are ignored

shinobu commented 8 years ago

I have reworked the names I kept the previous FILTER_ERROR (now NON_FATAL_ERROR) - because OntoWiki could theoretically be checked in the ErrorController.php (it checks for codes above 0 and below 2k and handles them differently)

shinobu commented 7 years ago

done and rebased onto your pull request @white-gecko