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

Format port errors for undefined values #270

Merged
merged 2 commits into from Sep 28, 2015

Conversation

Projects
None yet
3 participants
@rtfeldman
Member

rtfeldman commented Jun 11, 2015

Before: (note the very last line)

Uncaught Error: Port Error:
Regarding the port named 'setParagraphs' with type:

    List Quiz.Question.Paragraph

You just sent the value:

    undefined

but it cannot be converted to the necessary type.
Runtime error when sending values through a port.
Expecting an array but was given 

After: (note the difference in the very last line)

Uncaught Error: Port Error:
Regarding the port named 'setParagraphs' with type:

    List Quiz.Question.Paragraph

You just sent the value:

    undefined

but it cannot be converted to the necessary type.
Runtime error when sending values through a port.
Expecting an array but was given undefined
Show outdated Hide outdated src/Native/Utils.js
@@ -325,12 +325,17 @@ Elm.Native.Utils.make = function(localRuntime) {
throw new Error('Runtime error in module ' + moduleName + ' (' + span + ')' + msg);
}
function formatValue(value) {

This comment has been minimized.

@ajhager

ajhager Aug 1, 2015

Contributor

I would bring the bracket down to the next line to match the style of the file, or even just remove the formatValue function and inline the check. Otherwise 👍 LGTM!

@ajhager

ajhager Aug 1, 2015

Contributor

I would bring the bracket down to the next line to match the style of the file, or even just remove the formatValue function and inline the check. Otherwise 👍 LGTM!

This comment has been minimized.

@evancz

evancz Aug 2, 2015

Member

Agree about this, one way or the other. After the change, @rtfeldman, please ping this thread for merge :)

@evancz

evancz Aug 2, 2015

Member

Agree about this, one way or the other. After the change, @rtfeldman, please ping this thread for merge :)

This comment has been minimized.

@rtfeldman

rtfeldman Aug 19, 2015

Member

Fixed in 4aca9b3

@rtfeldman
@rtfeldman

This comment has been minimized.

Show comment
Hide comment
@rtfeldman

rtfeldman Sep 28, 2015

Member

@evancz this should be ready to merge now!

Member

rtfeldman commented Sep 28, 2015

@evancz this should be ready to merge now!

evancz pushed a commit that referenced this pull request Sep 28, 2015

@evancz evancz merged commit 6a49588 into elm:master Sep 28, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Sep 28, 2015

Member

Looks good, thanks!

Member

evancz commented Sep 28, 2015

Looks good, thanks!

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