Skip to content
Permalink
Browse files
feat: add persistent file logger to record the errors occured in webh…
…ooks.
  • Loading branch information
plainheart committed Nov 26, 2020
1 parent 4b763ca commit 831a6b90dbc1147b1c193539fbc062d197c5a8e4
Showing 4 changed files with 312 additions and 1 deletion.
@@ -1,6 +1,7 @@
const Issue = require('./src/issue');
const text = require('./src/text');
const { isCommitter } = require('./src/coreCommitters');
const logger = require('./src/logger');

module.exports = ({ app }) => {
app.on(['issues.opened'], async context => {
@@ -165,6 +166,11 @@ module.exports = ({ app }) => {
return Promise.all([addLabel, removeLabel]);
}
});

app.webhooks.onError(error => {
logger.error('bot occured an error');
logger.error(error);
});
}

function getRemoveLabel(context, name) {

Some generated files are not rendered by default. Learn more.

0 comments on commit 831a6b9

Please sign in to comment.