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

Catch runtime error when creating a Regex from an invalid expression #713

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@aische

aische commented Sep 16, 2016

Giving an invalid regex string to the function 'regex' crashes Elm. This is bad if you want to create a regex from user input. A function safeRegex could be added that tries to create the regex, and returns 'Just Regex' if it succeeds, or Nothing in case of an error.

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Sep 16, 2016

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Sep 16, 2016

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Sep 16, 2016

Contributor

This is kind of a duplicate of https://github.com/elm-lang/core/pull/380. I suggest closing it, and continuing discussion there (if need for discussion, rather than decision, exists).

Contributor

jvoigtlaender commented Sep 16, 2016

This is kind of a duplicate of https://github.com/elm-lang/core/pull/380. I suggest closing it, and continuing discussion there (if need for discussion, rather than decision, exists).

@aische

This comment has been minimized.

Show comment
Hide comment
@aische

aische Sep 16, 2016

Ah I did not see that. Sorry for duplication and the noise!

aische commented Sep 16, 2016

Ah I did not see that. Sorry for duplication and the noise!

@aische aische closed this Sep 16, 2016

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