Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/js/PKI.js/src/errors/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 742 B image not shown  

Quelle  AsnError.ts   Sprache: unbekannt

 
export interface AsnFromBerResult {
  offset: number;
  result: any;
}

export interface AsnCompareSchemaResult {
  verified: boolean;
  result?: any;
}

export class AsnError extends Error {

  static assertSchema(asn1: AsnCompareSchemaResult, target: string): asserts asn1 is { verified: true, result: any; } {
    if (!asn1.verified) {
      throw new Error(`Object's schema was not verified against input data for ${target}`);
    }
  }

  public static assert(asn: AsnFromBerResult, target: string): void {
    if (asn.offset === -1) {
      throw new AsnError(`Error during parsing of ASN.1 data. Data is not correct for '${target}'.`);
    }
  }

  constructor(message: string) {
    super(message);

    this.name = "AsnError";
  }

}

[ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet)  ]