summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-22 15:41:14 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-22 15:41:14 +0100
commite64cccc8cf705f1894ca106042945ee0d85cc77f (patch)
tree2665ac3f10558101d2f93ddc57b22bcab621e88d
parent72a1224f85b6ddfde478f5a1d5a33c4e7b392157 (diff)
downloadfuzzer-e64cccc8cf705f1894ca106042945ee0d85cc77f.tar.gz
catch unknown state error
-rwxr-xr-xrtt-module.js12
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)