Skip to content

Commit

Permalink
fix: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zetxx committed Jan 21, 2020
1 parent 58350e6 commit 726db80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class Brid {
this.apiMethods[channel][method] = async(ctx, ...args) => {
let [message, meta] = args;
this.log('trace', {in: 'base.registerMethod', description: `exec method: ${channel}.${method}`, message, meta: getSerializableMeta(meta)});
return fn.call(ctx, ...args);
try {
return fn.call(ctx, ...args);
} catch (e) {
this.log('error', {in: 'base.registerMethod', description: `exec method: ${channel}.${method}`, meta: getSerializableMeta(meta), error: e});
throw e;
}
};
}

Expand Down

0 comments on commit 726db80

Please sign in to comment.