From e64cccc8cf705f1894ca106042945ee0d85cc77f Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:41:14 +0100 Subject: catch unknown state error --- rtt-module.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- cgit v1.2.3