Skip to content

Commit

Permalink
Change what error (1) is used for
Browse files Browse the repository at this point in the history
  • Loading branch information
evancz committed Sep 20, 2017
1 parent 23a4c37 commit 685a548
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion hints/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ If you let their support team know about this error, please give them a link to

## Info for Developers

When you initialize your Elm application, you are not providing any flags like `Elm.App.fullscreen()` but the application needs some flags.
The application transitioned to a new URL, but the `Url.Parser.toUrl` function could not handle it. It probably is an unsupported URL like a `file://` or `data://` URL but it may be a bug in the [`elm-lang/url`][url] package. Explore more and report an [SSCCE](http://sscce.org/) if you can definitively show it is a bug.

You can get more detailed information if you can reproduce the error in dev mode.

Hopefully that helps!

[url]: https://github.com/elm-lang/url
9 changes: 4 additions & 5 deletions src/Elm/Kernel/Error.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ function _Error_throw__DEBUG(identifier, fact1, fact2, fact3, fact4)
throw new Error('The `' + moduleName + '` module does not need flags.\nInitialize it with no arguments and you should be all set!');

case 1:
var moduleName = fact1;
throw new Error('Are you trying to sneak a Never value into Elm? Trickster!\nIt looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\nUse `program` instead if you do not want flags.');
var url = fact1;
throw new Error('Cannot navigate to the following URL. It seems to be invalid:\n' + url);

case 2:
var moduleName = fact1;
var message = fact2;
throw new Error('Trying to initialize the `' + moduleName + '` module with an unexpected argument.\nI tried to convert it to an Elm value, but ran into this problem:\n\n' + message);
var message = fact1;
throw new Error('Problem with the flags given to your Elm program on initialization.\n\n' + message);

case 3:
var portName = fact1;
Expand Down

0 comments on commit 685a548

Please sign in to comment.