0.0.2 • Published 9 years ago

error-interface v0.0.2

Weekly downloads
7
License
-
Repository
-
Last release
9 years ago

error-interface

Error Interface for handling a sequence of errors, And then it posts to an API endpoint.

Installation

Install the module with: npm install error-interface --save

Documentation
var errorInterface = new require('error-interface')({

	url: 'http://error.myapp.com' // API end point that receives the data.

	api: 'users' // name of the API that produced the error.

	type: 'warning' // type of error. It Can be anything you want.

});

// change the type on the fly.

errorInterface.config.type = 'log';

// accessing the log directly:

errorInterface.log.error // Array

// add error,

errorInterface.error({});

// save errors stored so far.

errorInterface.do();

// You can define a new type in this point too.

errorInterface.do( { type: 'fatal' } );

// clean all errors stored so far.

errorInterface.clean();

// Cleans the last error, And returns the last entry in the error array.

errorInterface.cleanLast();

// update directly all errors.

errorInterface.update([]);

// show errors stored so far. (It does a console.error.).

errorInterface.show();

License

Copyright (c) 2015 C.C.D.

Licensed under the MIT license.

Copyright (c) 2015 C.C.D.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.