/**
 * Description: This is a SoundFont2 parser.
 *
 * @package     midi-Synth
 * @category    module js
 * @author      Mrtenz <https://github.com/Mrtenz/soundfont2>
 * @copyright   soundfont2
 * @license     GPL-2.0-or-later
 */

/**
 * Error class used for all errors encountered during the parsing of the SoundFont 2 file.
 */
class ParseError extends Error {
  constructor(message, expected, received) {
    super(
      `${message}${
        expected && received
          ? `, expected ${expected}, received ${received}`
          : ``
      }`
    )
    this.err = `${message}${
        expected && received
          ? `, expected ${expected}, received ${received}`
          : ``
      }`;
    document.getElementById("inform_panel").style.color = "red";
    document.getElementById("inform_panel").innerHTML = "file .sf2 is corrupted";
  }
}
