You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i call this let response = session.send_command(&Command::StartQuest { quest_pos: (3), overwrite_inv: (true) }).await.unwrap();
anp got this err message called Result::unwrap() on an Err value: ServerError("adventure index must be 1-3")
which is strongly unintuitive because the range is from 0-2, i'am not sure from where this error mesage goes, because i read that you are changing the values because of sfgame servers but i thing that this error message shouldnt be let as it is
The text was updated successfully, but these errors were encountered:
Yeah, that is because the 1-3 error message is directly passes through from the server, which only sees the modified (+1) value, so 4 in that case. I still think modifying the passed in values is overall more beneficial, as you can just pass the index of stuff, instead of having +1 everywhere yourself, so I am not changing that, but I agree, that just passing through the error is also bad.
The best way forward would probably be to just to do bounds checks everywhere and return a custom error, instead of the server error. I tried to stay away from that until now to make sure I would not accidentaly introduce false errors, or change the meaning of errors (connection error -> out of bounds error), but yeah, those error messages are for sure guiding people in the wrong direction. I need to fix that for the next release, thanks for the report
i call this
let response = session.send_command(&Command::StartQuest { quest_pos: (3), overwrite_inv: (true) }).await.unwrap();
anp got this err message
called
Result::unwrap()
on anErr
value: ServerError("adventure index must be 1-3")which is strongly unintuitive because the range is from 0-2, i'am not sure from where this error mesage goes, because i read that you are changing the values because of sfgame servers but i thing that this error message shouldnt be let as it is
The text was updated successfully, but these errors were encountered: