lib/error.js
function MIDIParserError(actual, expected, byte) {
    Error.call(this);
    Error.captureStackTrace(this, this.constructor);

    this.name = this.constructor.name;
    this.actual = actual;
    this.expected = expected;

    actual = format(actual);
    expected = format(expected);

    this.message = 'Invalid MIDI file: expected ' +
        expected + ' but found ' + actual;

    if (byte !== undefined) {
        this.byte = byte;
        this.message += ' (at byte ' + byte + ')';
    }
}
function MIDIParserError(actual, expected, byte) {
    Error.call(this);
    Error.captureStackTrace(this, this.constructor);

    this.name = this.constructor.name;
    this.actual = actual;
    this.expected = expected;

    actual = format(actual);
    expected = format(expected);

    this.message = 'Invalid MIDI file: expected ' +
        expected + ' but found ' + actual;

    if (byte !== undefined) {
        this.byte = byte;
        this.message += ' (at byte ' + byte + ')';
    }
}
function MIDIParserError ( actual , expected , byte ) { Error . call ( this ) ; Error . captureStackTrace ( this , this . constructor ) ; this . name = this . constructor . name ; this . actual = actual ; this . expected = expected ; actual = format ( actual ) ; expected = format ( expected ) ; this . message = 'Invalid MIDI file: expected ' + expected + ' but found ' + actual ; if ( byte !== undefined ) { this . byte = byte ; this . message += ' (at byte ' + byte + ')' ; } }
Consruct a new MIDIParserError

@class MIDIParserError
@extends Error
@classdesc An error that occured while parsing a MIDI file

@param {*} actual Actual value
@param {*} expected Expected value
@param {number} [byte] The byte at which the error occured
Consruct a new MIDIParserError