-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix: error message for provider failure was not descriptive #120
Conversation
self.providers[provider_name](provider_settings=provider_settings), | ||
) | ||
except TypeError as e: | ||
raise Exception(f"Plugin {provider_name} failed to load!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left it as Exception
for consistency with the rest of the file, should I refactor it to Abort
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e
is not used, I could include it something like:
except TypeError as e:
raise Exception(f"Plugin {provider_name} failed to load!",e)```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also doesn't note the failure and skip loading that plugin module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk more about how to fix this one
try: | ||
return ProviderContextManager( | ||
self.ecosystem.network_manager, | ||
self.providers[provider_name](provider_settings=provider_settings), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrapped the return
statement, since I wasn't sure how to wrap just the one argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More like this (pull out the statement that needs the try...except)
try:
provider = self.providers[provider_name](provider_settings=provider_settings)
...
return ProviderContextManager(
...,
provider,
...,
)
closing in favor of #121 |
What I did
fixed nondescriptive error message
TypeError: Can't instantiate abstract class Infura with abstract methods chain_id
Related issue: #
#119
ApeWorX/ape-infura#1
How I did it
wrapped the offending line in
try... except
How to verify it
I run
ape console --network ethereum:ropsten:infura
but the infura plugin is brokenChecklist