Skip to content

Commit

Permalink
Merge pull request #14 from baidu/pluginlog
Browse files Browse the repository at this point in the history
fix(plugin) print runtime exception stack to plugin.log
  • Loading branch information
CaledoniaProject authored Sep 22, 2017
2 parents d7b7125 + 75ad14d commit 9319f80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions agent/java/src/main/resources/environment/rasp.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ const RASP = class {
try {
result = checkProcess.func(checkParams, checkContext);
} catch (e) {
result.message = e.message;
result.action = e instanceof Attack ? 'block' : 'log';
if (e instanceof Attack) {
result.action = 'block';
result.message = e.message;
} else {
console.log(e.stack);
result.action = 'ignore';
result.message = '';
}
}
result = typeof(result) === 'object' ? result : {};
result.action = result.action || 'log';
Expand Down

0 comments on commit 9319f80

Please sign in to comment.