sponsor Vim development Vim logo Vim Book Ad

erroneous : The right way to handle errors

 script karma  Rating 0/0, Downloaded by 123    Comments, bugs, improvements  Vim wiki

created by
Idan Arye
 
script type
utility
 
description
GitHub repository: https://github.com/someboddy/vim-erroneous

Erroneous is a plugin for handling errors from external programs. Vim provides you with the :make command to run compilers and parse the errors using the 'errorformat' option, but you must set the 'errorformat' option in advance. If you use more than one language regularly, you'll have to change 'errorformat' often. This is usually done with file-type plugins - but that means you have to always compile from one of the source files(you can't, for example, compile from one of the configuration XML files). You can also set a long, compound 'errorformat' that can catch errors in many formats - but from my experience those catch-all 'errorformat's tend to identify error-description lines as error headlines and create entries in the quickfix list that are mapped to nowhere and send you to empty buffers. Not as fun as it sounds...

Erroneous takes a different approach - instead of parsing stderr based on the filetype, parsing is done based on the shell command that invoked the program that created the error. So, if you run javac MyClass.java Erroneous will automatically set the 'errorformat' to parse javac errors, while running gcc main.c will cause Erroneous to set 'errorformat' to parse gcc errors.

Erroneous can also read shebangs to know how to parse errors of interepted scripts in linux, and it provides API for other plugins that want to determine the error format by other means.
 
install details
After extracting the zip/cloning from GitHub, you need to set the g:erroneous_errorFormatChooserPatterns and/or the g:erroneous_errorFormatChooserWords dictionaries. See ":help erroneous-configurations" for instructions how to do that.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
erroneous_v1.1.0.zip 1.1.0 2013-12-02 7.0 Idan Arye * Added erroneous#parseXBuildErrorOutput for handling XBuild and MSBuild.
* Can now read the shell exit code even without Ruby, so you no longer need Ruby support to run Maven(with Ruby it's still more awesome though).
erroneous_v1.0.0.zip 1.0.0 2013-02-12 7.3 Idan Arye Initial upload
ip used for rating: 107.22.37.143

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo