Skip to content

SanderSpies/BetterErrors

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Before

Before

After

Glorious After

Before

Before

After

Glorious After

Work in progress!

npm install -g ocamlBetterErrors

Put this in your project's package.json:

{
  "scripts": {
    "start": "eval $(dependencyEnv) && nopam && which berror.native"
  },
  "dependencies": {
    "nopam": "*",
    "dependency-env": "*",
    "ocamlBetterErrors": "*"
  }
}

Running npm start with such configuration will expose the berror.native binary, for you to use like so:

ocamlc myApp.ml |& berror.native

Explanation: |& is a bash shortcut for 2>&1 | (not available in vanilla sh), which, in turn, means "pipe the stuff from stderr into stdout, then pipe it back into stdin of the next command". berror takes in this info and searches for errors to pretty-print back.

To format the output in Reason syntax, use berror --path-to-refmttype thePathToRefmttype (where refmttype is a binary exposed by Reason).

Have fun!

For Development

git clone this repo, cd into it, then run:

npm install
# to compile
npm start
# to test, currently broken
npm test

About

Make OCaml Errors Great Again.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 79.8%
  • C++ 19.8%
  • Standard ML 0.4%