You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

pug-error

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-error

Standard error objects for jade


Version published
Maintainers
1
Created

Readme

Source

jade-error

Standard error objects for jade. This module is intended for use by the lexer, parser, loader, linker, code-generator and any plugins.

Build Status Dependency Status NPM version

Installation

npm install jade-error

Usage

var error = require('jade-error');

error(code, message, options)

Create a Jade error object.

code is a required unique code for the error type that can be used to pinpoint a certain error.

message is a human-readable explanation of the error.

options can contain any of the following properties:

  • filename: the name of the file causing the error
  • line: the offending line
  • column: the offending column
  • src: the Jade source, if available, for pretty-printing the error context

The resulting error object is a simple Error object with additional properties given in the arguments.

Caveat: the message argument is stored in err.msg, not err.message, which is occupied with a better-formatted message.

var error = require('jade-error');

var err = error('MY_CODE', 'My message', {line: 3, filename: 'myfile', src: 'foo\nbar\nbaz\nbash\nbing'});
// { code: 'JADE:MY_CODE',
//   msg: 'My message',
//   line: 3,
//   column: undefined,
//   filename: 'myfile',
//   src: 'foo\nbar\nbaz\nbash\nbing',
//   message: 'myfile:3\n    1| foo\n    2| bar\n  > 3| baz\n    4| bash\n    5| bing\n\nMy message' }

throw err;

License

MIT

Keywords

FAQs

Package last updated on 04 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc