-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Refactor module & runtime error handing #2880
Conversation
@bkchr can you take a look when you have time? Just want to make sure I am on the right track. |
c0b6863
to
61a5661
Compare
61a5661
to
3039e7c
Compare
85cfeaa
to
c5c2e5a
Compare
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 think the general direction looks good :)
@tomusdrw you maybe also want to take a first peek :) |
cc4ed6f
to
ed20244
Compare
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.
Awesome work! Looks really impressive and mostly good for me.
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
I cannot get it compile without modify every modules |
What would be the modifications? And in general I don't see the problem? Introducing a new feature some times requires to touch every module. |
Every module will need Error type in Trait similar to Event. It is fine I guess but will make this PR very large. |
Why does it need And do you also support nesting errors? If yes, how is this solved? Theoretically you could have an infinite nesting, how do I find the root cause? |
It is complicated... Nesting error is not really supported.
and module Error type is like
One way to handle nested error is convert the underlying error to the module error type, by add variants to error enum. Or if the error is from another module, just add |
8a01ca2
to
7587ce3
Compare
7587ce3
to
efe953a
Compare
in any case will need resolving if it is to go in soon |
I'm currently looking into this. (JFYI) |
I am going to do some refactor to make this work with |
Can you postpone this? I started to write some code already for this pr. |
Sure. I just started it and got distracted. Will wait for your one instead. |
@bkchr any updates? |
Yeah, after a lot of Kusama related task, I finally have time to work on this. I merged master and now try some things. |
Superseded by: #3433 |
Fixes #2246
This PR should:
decl_error
.construct_runtime
macro to generate a runtimeError
ensure backward compatibility (needs help from @bkchr )(I don't think this is needed anymore)Next stage (won't be in this PR) will :
decl_error
to each module and replace all the string errorcc @jacogr this introduces a new type
DispatchError
, without additional metadata, SDK won't be able to know the the meaning of the error code, but we can kind of solve it by duplicate the definition of theError
enum like other types.