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

Implement global try/catch error to catch all unexpected js errors #7

Open
amcoho opened this issue Jul 9, 2018 · 4 comments
Open
Assignees

Comments

@amcoho
Copy link
Collaborator

amcoho commented Jul 9, 2018

catch block should de-initialize all the js initialization work so user can use the no-js version.

@smohadjer
Copy link
Owner

I will insert an intentional error in step 2 so we can test this scenario. If error happens I will remove all event listeners. I don’t think we need to do anything else.

@smohadjer
Copy link
Owner

On a second thought, I don't think we need this. Using a global try/catch in Formwizrd class would only catch errors thrown by code in that class, which is not what we want since we can deal with such errors during testing and before run-time. Errors thrown by 3rd party code would happen either before or after class has initialised which in either case would not harm the Formwizard. If error happens before, Formwizard won't initialise and form will run without js enhancements which is fine. If error happens after, it has no impact on Formwizard class.

@smohadjer smohadjer reopened this Jul 11, 2018
@smohadjer smohadjer assigned amcoho and unassigned smohadjer Jul 11, 2018
@smohadjer
Copy link
Owner

@amcoho Go ahead and add a js error that makes the form non-functional. We have to be able to reproduce a problem before we try to fix it.

@smohadjer
Copy link
Owner

@amcoho Should we close this?

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

No branches or pull requests

2 participants