a zip code crypto-currency system good for red ONLY
Eric Foster d5378345de connection between front end and database 6 vuotta sitten
..
test connection between front end and database 6 vuotta sitten
.istanbul.yml connection between front end and database 6 vuotta sitten
.npmignore connection between front end and database 6 vuotta sitten
MIGRATION.md connection between front end and database 6 vuotta sitten
README.md connection between front end and database 6 vuotta sitten
docs.mli connection between front end and database 6 vuotta sitten
io.js connection between front end and database 6 vuotta sitten
option.js connection between front end and database 6 vuotta sitten
package.json connection between front end and database 6 vuotta sitten
typed.js connection between front end and database 6 vuotta sitten
validation.js connection between front end and database 6 vuotta sitten
wrapped.js connection between front end and database 6 vuotta sitten

README.md

error

Custom errors

Typed Error

var TypedError = require("error/typed")

var ServerError = TypedError({
    type: 'server.5xx',
    message: '{title} server error, status={statusCode}',
    title: null,
    statusCode: null
});
var ClientError = TypedError({
    type: 'client.4xx',
    message: '{title} client error, status={statusCode}',
    title: null,
    statusCode: null
});

var error = ServerError({
    title:'some title',
    statusCode: 500
});
var error2 = ClientError({
    title: 'some title',
    statusCode: 404
});

Wrapped Errors

var net = require('net');
var WrappedError = require('error/wrapped');

var ServerListenError = WrappedError({
    message: 'server: {origMessage}',
    type: 'server.listen-failed',
    requestedPort: null,
    host: null
});

var server = net.createServer();

server.on('error', function onError(err) {
    if (err.code === 'EADDRINUSE') {
        throw ServerListenError(err, {
            requestedPort: 3000,
            host: null
        });
    } else {
        throw err;
    }
});

server.listen(3000);

Installation

npm install error

Contributors

  • Raynos

MIT Licenced