https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

constructor(msg, code) {
    super(msg);
    this.code = code;
  }
}
class UnknownErrorException extends BaseException {
  constructor(msg, details) {
    super(msg);
    this.details = details;
  }
}
class InvalidPDFException extends BaseException {}
class MissingPDFException extends BaseException {}
class UnexpectedResponseException extends BaseException {
  constructor(msg, status) {
    super(msg);
    this.status = status;
  }
}
/**
 * Error caused during parsing PDF data.
 */
class FormatError extends BaseException {}
/**
 * Error used to indicate task cancellation.
 */
class AbortException extends BaseException {}