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

Wrong bot toml path has bad error message #56

Open
NicEastvillage opened this issue Oct 25, 2024 · 5 comments
Open

Wrong bot toml path has bad error message #56

NicEastvillage opened this issue Oct 25, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@NicEastvillage
Copy link
Contributor

If you mess up your path to your bot in your toml, at least in Python, you get a very quiet "the path does not exist" or whatever and that's it. No hint about what path or what the issue is
I can't even tell what bot it's coming from, what file, what line of what code, I get zero info. It's gonna be an issue
- kaiyotech

@NicEastvillage NicEastvillage added enhancement New feature or request good first issue Good for newcomers labels Oct 25, 2024
@swz-git
Copy link
Member

swz-git commented Oct 25, 2024

The error message comes from cmd.exe and we can't really change it. What we should do imo is log a big red error message when a bot exits with a non-zero exit code. That way you can pretty easily figure out why it crashed by looking at the line above.

@Kaiyotech
Copy link

I mean, you could check path before attempting to parse it, so you could say "failed to find path xxx" if it's going to fail. Or you could just print "Parsing toml" and then when it fails that at least points to the toml file for the bot that failed (if we add your red warning), but I definitely appreciate that the console is relatively quiet currently and we don't want a bunch of "checking. Complete, checking, complete" garbage.

@swz-git
Copy link
Member

swz-git commented Oct 25, 2024

That doesn't work because run_command doesn't need to be a path (and core doesn't even parse it). Its a batch command (or /bin/sh command on linux). Though we could still point to the toml path, agent_id and/or the run_command of the bot that failed when it fails in the error message I suggested above.

@Kaiyotech
Copy link

Ok. I see. Because the run command can be complex we can't really check it beforehand to make sure it's valid. We could, but it's a mess probably. Just something that at least points to the toml would be enough.

@VirxEC
Copy link
Collaborator

VirxEC commented Oct 25, 2024

I agree with swz, the best we can probably do is a big bold red error message "{bot/script name}'s process exited with a non-0 status" to make it a bit more clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants