-
Notifications
You must be signed in to change notification settings - Fork 72
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
Throwing errors instead of fatalError #15
Comments
Yeah I was wondering about that the first time I added I didn't want to use
If we don't So that was my reasoning at the time. Maybe moving to |
Agree that this will make to use try! with every resolve, but that's good for developer, I think, cause it indicates that this is a point where something can go wrong. So developer should think upfront is it safe to use. With fatalError he will notice that he did something wrong only at runtime. Also (just imagining, didn't thought through) there can be use cases for something like plugin systems or something backed up by in-app purchases, when not having a registered component does not mean a fatal error. The other important argument for throwing is that we will be able to test such negative cases in Dip unit test. |
Ok, you convinced me migrating to |
Maybe we can have some kind of roadmap that we discuss upfront and have somewhere in this repo which will outline a set of features we plan to release? Also we can use it to discuss do we ever need particular features or not and where will they go - in core or extensions. |
Yeah we should. I also like to use GitHub milestones to prioritize issues and tell in which version they are plan to go like a RoadMap, and use GitHub labels to tag issues (like we could have a "Core" and "Extensions" labels) |
Wiki page will be ok I think |
Well actually I think about this:
You should have all the necessary access right to start all this (milestones, labels, wiki) on your own if you want (I have to go tonight) otherwise will look at it tomorrow evening. |
@ilyapuchka I've created this wiki page for a start, and also the two |
Probably we should consider throwing errors in
resolve
instead of usingfatalError
. For now we use it only in one place, but there could be more places where we will need to signal developer that something is wrong.try
enforces developer to pay attention to possible errors. Also with throwing errors we can test those invalid cases what we can't do withfatalError
.The text was updated successfully, but these errors were encountered: