Skip to content

Improved error reporting in psc-bundle#1307

Merged
paf31 merged 4 commits intopurescript:masterfrom
hdgarrood:bundle-error-reporting
Jul 26, 2015
Merged

Improved error reporting in psc-bundle#1307
paf31 merged 4 commits intopurescript:masterfrom
hdgarrood:bundle-error-reporting

Conversation

@hdgarrood
Copy link
Copy Markdown
Contributor

This is along the same lines as #1207 but it uses ErrorInFile, although I renamed to ErrorInModule, as we don't have the file information readily to hand. I also included the error from language-javascript (which is just a String) if the parsing fails. Here's an example output (the error arises from non-ascii characters in string literals, #1265):

$ pulp build --include benchmarks --main Benchmark.Main -O --to main.js
* Building project in /home/harry/documents/code/purescript-sequences
* Build successful.
* Bundling Javascript...
Error in module Benchotron.UI.Console (Regular):

  The module could not be parsed:
  lexical error @ line 67 and column 176

(by the way, that --include option for pulp doesn't exist yet, I'm developing it at the moment)

At the moment, it prints the ModuleType (Regular or Foreign) using the Show instance. Perhaps there's a better way of displaying this information?

If language-javascript cannot parse a javascript file as part of
psc-bundle, the error message is now included in the error that
psc-bundle emits.
paf31 added a commit that referenced this pull request Jul 26, 2015
Improved error reporting in psc-bundle
@paf31 paf31 merged commit 24eb832 into purescript:master Jul 26, 2015
@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Jul 26, 2015

👍 Thanks!

@hdgarrood hdgarrood deleted the bundle-error-reporting branch July 26, 2015 16:18
@garyb garyb mentioned this pull request Aug 3, 2015
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

Successfully merging this pull request may close these issues.

2 participants