fix: created custom error when env var for providers does not exist or unknown provider, moderator is attempted to be loaded#69
Conversation
codefromthecrypt
left a comment
There was a problem hiding this comment.
looks like progress
src/exchange/providers/base.py
Outdated
There was a problem hiding this comment.
maybe rename instructions to instructions_url?
Also, not sure style, but if ok with multi-line error we could \n this and then make the asserts multi-line
| self.message += f". {instructions}" | |
| self.message += f". See {instructions} for instructions." |
There was a problem hiding this comment.
Thanks @codefromthecrypt for your feedback!
Yes, we can rename to instructions_url so that we will have consistent message pattern. On the other hand, I am thinking whether we shall have some flexibility for the instructions. For example, people can put instructions without url. It is hard to know the future :).
I'll change as you suggested, in case we want to have more flexibility, it is fine because the function signature won't change anyway.
Also I've added the error message for unknown configuration values and put the screenshot in block/goose#103. I would like to get your feedback too! Thank you!
|
moved the change to block/goose#103 |
Why
Currently it throws a runtime error and print the stack trace when
This make it hard for users to understand what is going.
What
provider,env_variableWith the above custom erros we can construct user friendly messages in goose
How will it be used
The errors will be caught in
goose. goose PRNote
This PR is for early feedback, and it won't be merged into this repo as @baxen is going to move this repo to
goose. I will move the PR change togooseaccordingly afterwards