Config 1.6: Error Codes

When something goes wrong, Genelet reports an error code and have the error interpretation delivered as a HTML page or JSON data.  Since the native http status code lies between 100 and 999, Genelet’s built-in error codes lies between 1001 and 1999.

You can define your project’s error codes in Errors in config.json, just to make sure they lie above 2000. The usage of error codes depends on programming languages but usually is a simple “return the_code” logic. Genelet will report customized errors codes in the same way as the built-in errors.

Errors       example: {"2001": "some error1", "2002": "some error2"}



Comments are closed.