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

[WIP] Add basic error handling #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gmaclennan
Copy link

Some initial ideas to fix #43

Feedback welcome!

@einarlove
Copy link
Member

This is definitely a missing feature, so thanks for taking a stabb at it.

@einarlove
Copy link
Member

einarlove commented Jun 23, 2017

Tried your solution and it works, but If you don't pass a mergeProps function you won't know if you got errors or not. One solution is to make the defaultMergeProps pass errors as errors prop by default.
With this approach there will always be an errors object with your keys as null.

props: {
  firstName: 'Einar',
  lastName: 'Löve',
  emoji: '👶',
  errors: {
    firstName: null,
    lastName: null,
    emoji: null,
  },
}

Not ideal.

I tried another approach where the props passed down could be an error instead. Take a look and see if it meets your needs.

Copy link
Contributor

@simenbrekken simenbrekken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is obsolete and I'd turning up in my review list.

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.

Handle errors?
3 participants