]>
git.r.bdr.sh - rbdr/forum/blob - lib/middleware/handle_errors.js
f969676bb9b66d625de2b94e9d15b9856caec112
2 * Middleware to create responses for unhandled errors.
4 export default async
function HandleErrors(next
) {
10 this.status
= err
.status
|| 500;
17 if (response
.status
=== 401) {
18 response
.error
=== 'Protected resource, use Authorization header to get access';
23 this.app
.emit('error', err
, this);