403Webshell
Server IP : 159.203.156.69  /  Your IP : 216.73.217.172
Web Server : nginx/1.24.0
System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/tanviranik.com/node_modules/vinext/dist/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/tanviranik.com/node_modules/vinext/dist/utils/error-cause.js.map
{"version":3,"file":"error-cause.js","names":[],"sources":["../../src/utils/error-cause.ts"],"sourcesContent":["/**\n * Embed an Error's `.cause` chain into its own `.message` and `.stack` so\n * single-pass formatters (Vite's \"Internal server error: ${err.message}\\n${err.stack}\"\n * dev-server logger, anything that just prints message + stack) reveal the\n * underlying root cause instead of silently dropping it.\n *\n * Without this, a wrapper like `new Error(\"Failed query\", { cause: pgError })`\n * shows up in the Vite dev console as just \"Failed query\" — the actual\n * ECONNREFUSED / role-missing / socket-error in `.cause` is lost.\n *\n * Intended for **dev-server use only**. Production loggers (Node's\n * `console.error` → `util.inspect`, workerd's runtime logger) already render\n * `.cause` natively, so calling this in prod would double-print the cause —\n * once in the synthesized message, once in util.inspect's `[cause]:` block.\n * Callers should gate on `process.env.NODE_ENV !== \"production\"` (Vite\n * build-time-replaces this, so the prod bundle gets a no-op).\n *\n * - Best-effort: never throws. Frozen / non-extensible errors are left untouched.\n * - Idempotent (repeat calls are no-ops via a non-enumerable module-private symbol).\n * - Cycle-safe and depth-capped (10) for pathological cause graphs.\n * - Cause stack frames are appended as `at` lines so stack-cleaning regexes\n *   like Vite's `/^\\s*at/` filter preserve them.\n */\nconst FLATTENED_MARKER = Symbol(\"vinext.errorCausesFlattened\");\nconst MAX_CAUSE_DEPTH = 10;\n\nfunction stringifyNonError(value: unknown): string {\n  if (typeof value === \"string\") return value;\n  if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") {\n    return String(value);\n  }\n  if (value === null || value === undefined) return String(value);\n  try {\n    return JSON.stringify(value) ?? Object.prototype.toString.call(value);\n  } catch {\n    return Object.prototype.toString.call(value);\n  }\n}\n\nexport function flattenErrorCauses(err: unknown): void {\n  if (!(err instanceof Error)) return;\n  const marked = err as Error & { [FLATTENED_MARKER]?: true };\n  if (marked[FLATTENED_MARKER]) return;\n  // defineProperty throws on frozen errors; mutations below also throw.\n  // Wrap each step so this function honours its \"never throw\" contract —\n  // a thrown TypeError here would propagate from the caller's catch block\n  // and replace the user's real error with our enrichment failure.\n  try {\n    Object.defineProperty(marked, FLATTENED_MARKER, {\n      value: true,\n      enumerable: false,\n      configurable: false,\n      writable: false,\n    });\n  } catch {\n    return;\n  }\n\n  const seen = new WeakSet<object>([err]);\n  const causes: Array<{ message: string; stack?: string }> = [];\n  let cur: unknown = (err as { cause?: unknown }).cause;\n  let depth = 0;\n  while (cur != null && depth < MAX_CAUSE_DEPTH) {\n    if (typeof cur === \"object\") {\n      if (seen.has(cur as object)) break;\n      seen.add(cur as object);\n    }\n    if (cur instanceof Error) {\n      causes.push({ message: cur.message, stack: cur.stack });\n      cur = (cur as { cause?: unknown }).cause;\n    } else {\n      causes.push({ message: stringifyNonError(cur) });\n      cur = null;\n    }\n    depth++;\n  }\n  if (causes.length === 0) return;\n\n  const messageSuffix = causes.map((c) => `  [cause]: ${c.message}`).join(\"\\n\");\n  try {\n    err.message = `${err.message}\\n${messageSuffix}`;\n  } catch {\n    // Frozen / non-writable .message — leave the rest untouched too,\n    // since a partial write would be misleading.\n    return;\n  }\n\n  if (typeof err.stack === \"string\") {\n    let stackSuffix = \"\";\n    for (const c of causes) {\n      const headline = c.message.split(\"\\n\", 1)[0];\n      stackSuffix += `\\n    at [cause: ${headline}]`;\n      if (c.stack) {\n        const frames = c.stack\n          .split(\"\\n\")\n          .filter((l) => /^\\s*at\\s/.test(l))\n          .join(\"\\n\");\n        if (frames) stackSuffix += `\\n${frames}`;\n      }\n    }\n    try {\n      err.stack = `${err.stack}${stackSuffix}`;\n    } catch {\n      // Stack is read-only on some hosts; message enrichment still holds.\n    }\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,mBAAmB,OAAO,8BAA8B;AAC9D,MAAM,kBAAkB;AAExB,SAAS,kBAAkB,OAAwB;CACjD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,OAAO,UAAU,UAC9E,OAAO,OAAO,MAAM;CAEtB,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO,OAAO,MAAM;CAC/D,IAAI;EACF,OAAO,KAAK,UAAU,MAAM,IAAI,OAAO,UAAU,SAAS,KAAK,MAAM;SAC/D;EACN,OAAO,OAAO,UAAU,SAAS,KAAK,MAAM;;;AAIhD,SAAgB,mBAAmB,KAAoB;CACrD,IAAI,EAAE,eAAe,QAAQ;CAC7B,MAAM,SAAS;CACf,IAAI,OAAO,mBAAmB;CAK9B,IAAI;EACF,OAAO,eAAe,QAAQ,kBAAkB;GAC9C,OAAO;GACP,YAAY;GACZ,cAAc;GACd,UAAU;GACX,CAAC;SACI;EACN;;CAGF,MAAM,OAAO,IAAI,QAAgB,CAAC,IAAI,CAAC;CACvC,MAAM,SAAqD,EAAE;CAC7D,IAAI,MAAgB,IAA4B;CAChD,IAAI,QAAQ;CACZ,OAAO,OAAO,QAAQ,QAAQ,iBAAiB;EAC7C,IAAI,OAAO,QAAQ,UAAU;GAC3B,IAAI,KAAK,IAAI,IAAc,EAAE;GAC7B,KAAK,IAAI,IAAc;;EAEzB,IAAI,eAAe,OAAO;GACxB,OAAO,KAAK;IAAE,SAAS,IAAI;IAAS,OAAO,IAAI;IAAO,CAAC;GACvD,MAAO,IAA4B;SAC9B;GACL,OAAO,KAAK,EAAE,SAAS,kBAAkB,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