src/utils.js
function (type, error = null, id = null) {
    type = type.toUpperCase()
    let errors = {
        'NO_DATA': 'No info for that id yet. Or maybe the data provided was wrong.',
        'BUSY': 'The server providing the info is busy right now. Try again.',
        'UNAVAILABLE': 'The server providing the info is unavailable right now. Try again later.',
        'EMPTY': 'The provider server was parsed correctly, but has no data to show. Try Again later.',
        'DOWN': 'The provider server is currently down. Try Again later.',
        'PARSER': 'Something went wrong when parsing the provider website.',
        'ACTION_REQUIRED': 'That tracker requires an aditional step in their website.'
    }

    let message = error != null ? error : errors[type]
    message = id != null ? message + ' ID:' + id : message
    return new Error(type + ' - ' + message)
}
function (type, error = null, id = null) {
    type = type.toUpperCase()
    let errors = {
        'NO_DATA': 'No info for that id yet. Or maybe the data provided was wrong.',
        'BUSY': 'The server providing the info is busy right now. Try again.',
        'UNAVAILABLE': 'The server providing the info is unavailable right now. Try again later.',
        'EMPTY': 'The provider server was parsed correctly, but has no data to show. Try Again later.',
        'DOWN': 'The provider server is currently down. Try Again later.',
        'PARSER': 'Something went wrong when parsing the provider website.',
        'ACTION_REQUIRED': 'That tracker requires an aditional step in their website.'
    }

    let message = error != null ? error : errors[type]
    message = id != null ? message + ' ID:' + id : message
    return new Error(type + ' - ' + message)
}
function ( type , error = null , id = null ) { type = type . toUpperCase ( ) let errors = { 'NO_DATA' : 'No info for that id yet. Or maybe the data provided was wrong.' , 'BUSY' : 'The server providing the info is busy right now. Try again.' , 'UNAVAILABLE' : 'The server providing the info is unavailable right now. Try again later.' , 'EMPTY' : 'The provider server was parsed correctly, but has no data to show. Try Again later.' , 'DOWN' : 'The provider server is currently down. Try Again later.' , 'PARSER' : 'Something went wrong when parsing the provider website.' , 'ACTION_REQUIRED' : 'That tracker requires an aditional step in their website.' } let message = error != null ? error : errors [ type ] message = id != null ? message + ' ID:' + id : message return new Error ( type + ' - ' + message ) }
Get the Error message by Type

@param type
@param error Error message
@returns {Error}
Get the Error message by Type