Skip to content

Switch the whole code base to the new error reporting API#2349

Merged
1 commit merged intomasterfrom
unknown repository
Jul 3, 2019
Merged

Switch the whole code base to the new error reporting API#2349
1 commit merged intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 3, 2019

This is the last PR to switch the code base to the new error reporting API. It convert all errors and warnings to the new API. As can be seen in the test suite, the formatting of a lot of error message is improved and the Error: prefix is added in many places where it was previously missing.

This diff is huge, however most of the changes are pretty mechanical. And since the majority of error messages are tested, it doesn't seem necessary to review the whole diff in detail. I suggest to simply read the diff of the test/ directory to review this PR.

Apart from the conversion of all errors, this PR also contains the following additional changes:

  • removal of the old exceptions taking strings
  • removal of all the old error reporting functions
  • deletion of the Errors module which was almost empty after these changes. I moved Already_reported to Report_error and merged Errors.print into Loc.print
  • moved a few pp functions in Dune_lang in a Deprecated sub-module in order to introduce a new pp function returning a _ Pp.t value

Copy link
Copy Markdown
Collaborator

@emillon emillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test diff looks good

@emillon
Copy link
Copy Markdown
Collaborator

emillon commented Jul 3, 2019

I think that the output could be made even better, for example by using hanging indent or putting "error:" on its own line when it wraps, but this will be made possible by switching to the new API. Thanks!

@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 3, 2019

Indeed, now that we have a robust and uniform way of reporting well formatted errors such changes should be much easier to do :)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
@ghost ghost merged commit 079b0cb into ocaml:master Jul 3, 2019
This pull request was closed.
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