-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor: add MarketError #670
refactor: add MarketError #670
Conversation
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.
Very nice, thanks @emizzle!
|
||
convertEthersError: | ||
let subscription = await market.contract.subscribe(ProofSubmitted, onEvent) | ||
return OnChainMarketSubscription(eventSubscription: subscription) | ||
|
||
method unsubscribe*(subscription: OnChainMarketSubscription) {.async.} = | ||
await subscription.eventSubscription.unsubscribe() |
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 one should probably also be wrapped in convertEthersError?
Wouldn't it be better/safer to return a |
@dryajov Well, that's an interesting yet difficult question to answer, as we've discussed in the past. Would you prefer that Given that there's only one place that catches If we changed to return a |
Sure, if the change cascades too many other changes, it might not be worth it. Overall I've since come around with the usage of result. I think the argument in are still valid (from both ends of the spectrum), but specifically to the ergonomics of result, things have improved (with |
eeead89
to
2493357
Compare
e3b505a
to
9d7b0dd
Compare
5ce32c9
to
555d2a7
Compare
cf827a8
to
d33804f
Compare
Add MarketError and convert all EthersErrors (ProviderError, SignerError) to MarketError
@dryajov I had a look at this, and I think for now, the changes this would introduce would be too many for the benefit. Perhaps we should create an issue and handle this another time? |
Add MarketError and convert all EthersErrors (ProviderError, SignerError) to MarketError
Note
Based on branch of PR #662.