2Elm.Native.Error.make = function(elm) {
3 elm.Native = elm.Native || {};
4 if (elm.Native.Error) return elm.Native.Error;
6 var fromString = Elm.Native.JavaScript.make(elm).fromString;
8 function indent(lines) {
10 for (var i = 0; i < lines.length; ++i) {
11 msg += '<br/> ' + lines[i];
16 function Case(moduleName, span) {
17 var msg = indent(['Non-exhaustive pattern match in case-expression.',
18 'Make sure your patterns cover every case!']);
19 throw new Error('Runtime error in module ' + moduleName + ' (' + span + '):' + msg);
22 function If(moduleName, span) {
23 var msg = indent(['Non-exhaustive pattern match in multi-way-if expression.',
24 'It is best to use \'otherwise\' as the last branch of multi-way-if.']);
25 throw new Error('Runtime error in module ' + moduleName + ' (' + span + '):' + msg);
28 function raise(str) { throw new Error(fromString(str)); }
30 return elm.Native.Error = { Case: Case, If: If, raise: raise };
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list