tilelive-error

1.0.0 • Public • Published

tilelive-error

I am a tilelive source and sink that only returns errors.

Usage

Return TileliveError instances to avoid repeating potential expensive and ultimately error-prone actions.

var TileliveError = require("tilelive-error");

var Source = function(uri, callback) {
  // doSomething is an expensive initalization operation
  // assumption: if an error is passed given the provided URI, it will *always*
  // be passed
  return doSomething(function(err, source) {
    if (err) {
      return new TileliveError(err, callback);
    }

    return callback(null, source);
  });
};

Readme

Keywords

none

Package Sidebar

Install

npm i tilelive-error

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • mojodna