diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-22 15:41:14 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-11-22 15:41:14 +0100 |
commit | e64cccc8cf705f1894ca106042945ee0d85cc77f (patch) | |
tree | 2665ac3f10558101d2f93ddc57b22bcab621e88d | |
parent | 72a1224f85b6ddfde478f5a1d5a33c4e7b392157 (diff) | |
download | fuzzer-e64cccc8cf705f1894ca106042945ee0d85cc77f.tar.gz |
catch unknown state error
-rwxr-xr-x | rtt-module.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rtt-module.js b/rtt-module.js index 6b13a98..e8f0cae 100755 --- a/rtt-module.js +++ b/rtt-module.js @@ -78,6 +78,11 @@ module.exports.fuzz = function(fuzzerInputData) { if (state.state === 'game_over') { break } + + if (view.prompt && view.prompt.startsWith("Unknown state:")) { + log_crash(game_setup, state, view, step, active) + throw new UnknownStateError(view.prompt) + } if (!view.actions) { log_crash(game_setup, state, view, step, active) @@ -156,6 +161,13 @@ class MaxStepsExceededError extends Error { } } +class UnknownStateError extends Error { + constructor(message) { + super(message) + this.name = "UnknownStateError" + } +} + class NoMoreActionsError extends Error { constructor(message) { super(message) |