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

Router should throw a different error when page hasn't changed at all #151

Open
PanoramicPanda opened this issue Feb 6, 2019 · 1 comment

Comments

@PanoramicPanda
Copy link
Member

Router currently throws RuntimeError: ERROR: The Application is on the wrong page! OZ expected that page to be [Page_Y] but found [Page_X]! whenever it lands on the improper page.

While still technically a routing issue, a more verbose/different error should likely be thrown when Page_X is the same page you just tried to leave.

@Castone22
Copy link
Contributor

Uriah and I were discussing a few things about this.

Essentially a more indepth case is the page doesn't do anything to tell you WHY it failed to navigate away from itself.

One of the lowest hanging fruits would be checking if fields were empty.
Potential solutions we discussed:

  • Add an optional flag to fields, required: true, that makes the page tell you if this field was empty if the error is hit.

    • Pros:
      • Declarative
    • Cons:
      • Bloats element creation hashes for something that's essentially a "Did i screw up check"
  • Just dump all empty or default value'd fields alongside the error message if they were enabled.

    • Pros
      • Doesn't require any rework on page classes
    • Cons
      • Clogs logs further
      • Doesn't tell you if a field was mandatory so you'd still have to check which fields were mandatory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants