Skip to content

Make errmsg part of module #8

@toymachiner62

Description

@toymachiner62

I see you have this nice function below which displays the actual error message. You should make this part of this package so that everyone doesn't have to manually implement this method.

function errmsg(err) {
    var str = 'Error: '
    // if it's a libuv error then get the description from errno
    if (errno.errno[err.errno]) {
        str += errno.errno[err.errno].description
    } else {
        str += err.message
    }

    // if it's a `fs` error then it'll have a 'path' property
    if (err.path) {
        str += ' [' + err.path + ']'
    }
    return str
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions