Skip to content
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

Provide more information on Routable fatalErrors #83

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

mokagio
Copy link
Member

@mokagio mokagio commented Oct 9, 2017

The default implementation for the function to push, pop, and change provided via protocol extension fatalErrors to notify developers that they haven't provided the required implementation.

The message used in the fatalError was not informative enough. These changes make it granular to the actual function being used, as well as adding the type that caused the failure, and the route element parameters that the code was trying to act on.

The new error message for push for example will look something like:

This routable cannot push segments. You have not implemented it.
(Asked RootRoutable to push landing)

@mokagio mokagio requested a review from Ben-G October 9, 2017 12:45
@codecov-io
Copy link

codecov-io commented Oct 9, 2017

Codecov Report

Merging #83 into master will increase coverage by 0.76%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
+ Coverage   80.28%   81.05%   +0.76%     
==========================================
  Files           5        5              
  Lines         208      227      +19     
==========================================
+ Hits          167      184      +17     
- Misses         41       43       +2
Impacted Files Coverage Δ
ReSwiftRouter/Routable.swift 0% <0%> (ø) ⬆️
ReSwiftRouter/Router.swift 83.43% <0%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02f8333...611d9a1. Read the comment docs.

The default implementation for the function to push, pon, and change
provided via protocol extension fatalErrors to notify developers that
they haven't provided the required implementation.

The message used in the fatalError was not informative enough. These
changes make it granular to the actual function being used, as well as
adding the type that caused the failure, and the route element
parameters that the code was trying to act on.

The new error message for push for example will look something like:

```
This routable cannot push segments. You have not implemented it.
(Asked RootRoutable to push landing)
```
@mokagio mokagio force-pushed the mokagio/fix-fatal-error-messages branch from a8045eb to 611d9a1 Compare October 17, 2017 10:46
@mokagio mokagio merged commit ba52e46 into master Oct 17, 2017
@mokagio mokagio deleted the mokagio/fix-fatal-error-messages branch October 17, 2017 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants