Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message on starting quest #38

Closed
tiquis0290 opened this issue Mar 11, 2024 · 1 comment · Fixed by #57
Closed

error message on starting quest #38

tiquis0290 opened this issue Mar 11, 2024 · 1 comment · Fixed by #57
Assignees
Labels
enhancement New feature or request

Comments

@tiquis0290
Copy link

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-marenga
Copy link
Owner

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

@the-marenga the-marenga added the enhancement New feature or request label Mar 11, 2024
@the-marenga the-marenga self-assigned this Mar 11, 2024
@the-marenga the-marenga linked a pull request Apr 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants