// Ported from js-yaml v3.13.1:
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

import type { Mark } from "./_mark.ts";

export class YAMLError extends Error {
  constructor(
    message = "(unknown reason)",
    protected mark: Mark | string = "",
  ) {
    super(`${message} ${mark}`);
    this.name = this.constructor.name;
  }

  override toString(): string {
    return `${this.name}: ${this.message} ${this.mark}`;
  }
}

// denoCacheMetadata={"headers":{"etag":"\"f4df760cf4f95be331259bfa5a3244ab\"","cross-origin-resource-policy":"cross-origin","accept-ranges":"bytes","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","alt-svc":"h3=\":443\"; ma=86400","date":"Tue, 28 Jul 2026 12:31:15 GMT","x-jsr-backend":"modules","cf-cache-status":"HIT","content-type":"text/typescript","content-length":"615","access-control-allow-origin":"*","access-control-expose-headers":"*","cf-ray":"a223e6586c607db6-LAX","cache-control":"public, max-age=31536000, immutable","x-robots-tag":"noindex","server":"cloudflare","vary":"Origin","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","x-content-type-options":"nosniff","set-cookie":"__cf_bm=thPb42dZHqXcBiZwp1Ak3ABsGfgtsSiGQFhGV9R_ldM-1785241875.2713406-1.0.1.1-0eJIztdh20QL7teLntTtqzYzKRp.PKuXR8fjGujTY5fGU06f2e_Sh.ujwjNwzj98v8UOJ19bHljdIfsVmIr6scaNDeozWdYN6r1rtiZ2xlvMQxymRgyI2RzSCpJvXnUY; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","age":"1643671","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=iyyw%2BDGvB4mZ77Wm7KPNg6cdMN74dhY2FyuxkTz0G2Fhfutdj1CQrOTHDytM27SVb20w0SI%2BDiiOjLNz1rabp6JU2RQJyTbMPnJPaAd58HOmjQXlCvjNSMg%3D\"}]}"},"url":"https://jsr.io/@std/yaml/0.224.3/_error.ts","time":1785241875}