Method errorHandler as middleware. Include ctx.app.emit('error') to log sensitive application error information (stack trace) into a file, database, kibana or any other log service.
Start to use ctx.throw for formatted exceptions by http status code.
Method errorHandler as middleware. Include ctx.app.emit('error') to log sensitive application error information (stack trace) into a file, database, kibana or any other log service. Start to use ctx.throw for formatted exceptions by http status code.
resolves #5
references: koajs error-handling 4 Chapter - Handling errors in Koa node api schema validation with joi toptal java error-handling padronização de resposta de erro em APIs standardized response bodies (RFC 7807) RF7807 (custom classes HttpException)[https://github.com/GoldL/island/blob/master/core/http-exception.js]