[{"data":1,"prerenderedAt":4861},["ShallowReactive",2],{"navigation_docs":3,"-logging-structured-errors":454,"-logging-structured-errors-surround":4856},[4,35,159,201,289,352,438],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,297,302,307,312,316,321,326,330,334,338,342,347],{"title":41,"path":295,"stem":296,"icon":54},"\u002Fbuild-on-top\u002Foverview","5.build-on-top\u002F0.overview",{"title":298,"path":299,"stem":300,"icon":301},"In-process stream","\u002Fbuild-on-top\u002Fin-process-stream","5.build-on-top\u002F1.in-process-stream","i-lucide-radio-tower",{"title":303,"path":304,"stem":305,"icon":306},"Fanout","\u002Fbuild-on-top\u002Ffanout-and-multi-drain","5.build-on-top\u002F10.fanout-and-multi-drain","i-lucide-share-2",{"title":308,"path":309,"stem":310,"icon":311},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F11.identity-headers","i-lucide-fingerprint",{"title":313,"path":314,"stem":315,"icon":288},"Custom framework","\u002Fbuild-on-top\u002Fcustom-framework","5.build-on-top\u002F12.custom-framework",{"title":317,"path":318,"stem":319,"icon":320},"Stream server","\u002Fbuild-on-top\u002Fstream-server","5.build-on-top\u002F2.stream-server","i-lucide-radio",{"title":322,"path":323,"stem":324,"icon":325},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F3.fs-reader","i-lucide-folder-search",{"title":156,"path":327,"stem":328,"icon":329},"\u002Fbuild-on-top\u002Fconsumer-recipes","5.build-on-top\u002F4.consumer-recipes","i-lucide-chef-hat",{"title":331,"path":332,"stem":333,"icon":288},"Plugins","\u002Fbuild-on-top\u002Fplugins","5.build-on-top\u002F5.plugins",{"title":335,"path":336,"stem":337,"icon":28},"Custom enrichers","\u002Fbuild-on-top\u002Fcustom-enrichers","5.build-on-top\u002F6.custom-enrichers",{"title":339,"path":340,"stem":341,"icon":178},"Tail sampling","\u002Fbuild-on-top\u002Ftail-sampling","5.build-on-top\u002F7.tail-sampling",{"title":343,"path":344,"stem":345,"icon":346},"Custom drains","\u002Fbuild-on-top\u002Fcustom-drains","5.build-on-top\u002F8.custom-drains","i-lucide-code-2",{"title":348,"path":349,"stem":350,"icon":351},"Drain pipeline","\u002Fbuild-on-top\u002Fdrain-pipeline","5.build-on-top\u002F9.drain-pipeline","i-lucide-workflow",{"title":353,"path":354,"stem":355,"children":356,"page":34},"Adapters","\u002Fadapters","6.adapters",[357,360,400,415],{"title":41,"path":358,"stem":359,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":361,"path":362,"stem":363,"children":364,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[365,370,375,380,385,390,395],{"title":366,"path":367,"stem":368,"icon":369},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":371,"path":372,"stem":373,"icon":374},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":376,"path":377,"stem":378,"icon":379},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":381,"path":382,"stem":383,"icon":384},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":386,"path":387,"stem":388,"icon":389},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":391,"path":392,"stem":393,"icon":394},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":396,"path":397,"stem":398,"icon":399},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":401,"path":402,"stem":403,"children":404,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[405,410],{"title":406,"path":407,"stem":408,"icon":409},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":411,"path":412,"stem":413,"icon":414},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":416,"path":417,"stem":418,"children":419,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[420,424,429,433],{"title":421,"path":422,"stem":423,"icon":351},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline",{"title":425,"path":426,"stem":427,"icon":428},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":430,"path":431,"stem":432,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":434,"path":435,"stem":436,"icon":437},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":439,"path":440,"stem":441,"children":442,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[443,446,450],{"title":41,"path":444,"stem":445,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":447,"path":448,"stem":449,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":451,"path":452,"stem":453,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":455,"title":56,"body":456,"description":4846,"extension":4847,"links":4848,"meta":4852,"navigation":4853,"path":57,"seo":4854,"stem":58,"__hash__":4855},"docs\u002F2.logging\u002F3.structured-errors.md",{"type":457,"value":458,"toc":4818},"minimark",[459,468,561,566,569,572,622,637,640,947,951,1069,1075,1089,1232,1279,1286,1290,1295,1410,1414,1672,1676,1679,1832,1838,1846,1849,2095,2118,2127,2131,2136,2630,2634,2637,2957,2960,2964,3241,3245,3401,3405,3430,3435,3446,4075,4089,4160,4164,4174,4311,4332,4338,4344,4477,4481,4498,4741,4744,4769,4781,4788,4792,4814],[460,461,462,463,467],"p",{},"evlog provides a ",[464,465,466],"code",{},"createError()"," function that creates errors with rich, actionable context.",[469,470,473,476,552],"prompt",{":actions":471,"description":472,"icon":59},"[\"copy\",\"cursor\",\"windsurf\"]","Use structured errors in my app",[460,474,475],{},"Use structured errors with code \u002F why \u002F fix \u002F link fields throughout my app.",[477,478,479,487,501,519,526,533,536,543],"ul",{},[480,481,482,483,486],"li",{},"Replace plain ",[464,484,485],{},"throw new Error(...)"," calls with createError({ code, message, status, why, fix, link })",[480,488,489,490,492,493,496,497,500],{},"Use ",[464,491,464],{}," as a stable, machine-readable identifier (e.g. ",[464,494,495],{},"'PAYMENT_DECLINED'",", ",[464,498,499],{},"'auth\u002Finvalid-token'",") so clients and dashboards can branch on it",[480,502,489,503,506,507,510,511,514,515,518],{},[464,504,505],{},"message"," for what happened, ",[464,508,509],{},"why"," for the technical reason, ",[464,512,513],{},"fix"," for the actionable solution, and ",[464,516,517],{},"link"," for docs",[480,520,521,522,525],{},"Set the appropriate HTTP ",[464,523,524],{},"status"," for API routes (400 \u002F 401 \u002F 402 \u002F 403 \u002F 404 \u002F 422 \u002F 500)",[480,527,528,529,532],{},"For internal-only context, pass ",[464,530,531],{},"internal: { ... }"," (logged but never returned in HTTP responses)",[480,534,535],{},"On the client, use parseError(err) to extract { message, status, code, why, fix, link } from any thrown error",[480,537,538,539,542],{},"Branch on ",[464,540,541],{},"parseError(err).code === 'PAYMENT_DECLINED'"," rather than parsing user-facing messages",[480,544,545,546,548,549,551],{},"Render ",[464,547,509],{}," and ",[464,550,513],{}," in toasts\u002FUI so users get actionable feedback",[460,553,554,555],{},"Docs: ",[556,557,558],"a",{"href":558,"rel":559},"https:\u002F\u002Fwww.evlog.dev\u002Flogging\u002Fstructured-errors",[560],"nofollow",[562,563,565],"h2",{"id":564},"why-structured-errors","Why Structured Errors?",[567,568],"structured-error-context",{},[460,570,571],{},"Traditional errors are often unhelpful:",[573,574,580],"pre",{"className":575,"code":576,"filename":577,"language":578,"meta":579,"style":579},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Unhelpful error\nthrow new Error('Payment failed')\n","server\u002Fapi\u002Fcheckout.post.ts","typescript","",[464,581,582,591],{"__ignoreMap":579},[583,584,587],"span",{"class":585,"line":586},"line",1,[583,588,590],{"class":589},"sHwdD","\u002F\u002F Unhelpful error\n",[583,592,594,598,602,606,610,613,617,619],{"class":585,"line":593},2,[583,595,597],{"class":596},"s7zQu","throw",[583,599,601],{"class":600},"sMK4o"," new",[583,603,605],{"class":604},"s2Zo4"," Error",[583,607,609],{"class":608},"sTEyZ","(",[583,611,612],{"class":600},"'",[583,614,616],{"class":615},"sfazB","Payment failed",[583,618,612],{"class":600},[583,620,621],{"class":608},")\n",[460,623,624,625,629,630,632,633,636],{},"This tells you ",[626,627,628],"em",{},"what"," happened, but not ",[626,631,509],{}," or ",[626,634,635],{},"how to fix it",".",[460,638,639],{},"Structured errors provide context:",[641,642,643,801],"code-group",{},[573,644,646],{"className":575,"code":645,"filename":577,"language":578,"meta":579,"style":579},"import { createError } from 'evlog'\n\nthrow createError({\n  code: 'PAYMENT_DECLINED',\n  message: 'Payment failed',\n  status: 402,\n  why: 'Card declined by issuer (insufficient funds)',\n  fix: 'Try a different payment method or contact your bank',\n  link: 'https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined',\n})\n",[464,647,648,674,680,692,712,728,742,759,776,793],{"__ignoreMap":579},[583,649,650,653,656,659,662,665,668,671],{"class":585,"line":586},[583,651,652],{"class":596},"import",[583,654,655],{"class":600}," {",[583,657,658],{"class":608}," createError",[583,660,661],{"class":600}," }",[583,663,664],{"class":596}," from",[583,666,667],{"class":600}," '",[583,669,670],{"class":615},"evlog",[583,672,673],{"class":600},"'\n",[583,675,676],{"class":585,"line":593},[583,677,679],{"emptyLinePlaceholder":678},true,"\n",[583,681,683,685,687,689],{"class":585,"line":682},3,[583,684,597],{"class":596},[583,686,658],{"class":604},[583,688,609],{"class":608},[583,690,691],{"class":600},"{\n",[583,693,695,699,702,704,707,709],{"class":585,"line":694},4,[583,696,698],{"class":697},"swJcz","  code",[583,700,701],{"class":600},":",[583,703,667],{"class":600},[583,705,706],{"class":615},"PAYMENT_DECLINED",[583,708,612],{"class":600},[583,710,711],{"class":600},",\n",[583,713,715,718,720,722,724,726],{"class":585,"line":714},5,[583,716,717],{"class":697},"  message",[583,719,701],{"class":600},[583,721,667],{"class":600},[583,723,616],{"class":615},[583,725,612],{"class":600},[583,727,711],{"class":600},[583,729,731,734,736,740],{"class":585,"line":730},6,[583,732,733],{"class":697},"  status",[583,735,701],{"class":600},[583,737,739],{"class":738},"sbssI"," 402",[583,741,711],{"class":600},[583,743,745,748,750,752,755,757],{"class":585,"line":744},7,[583,746,747],{"class":697},"  why",[583,749,701],{"class":600},[583,751,667],{"class":600},[583,753,754],{"class":615},"Card declined by issuer (insufficient funds)",[583,756,612],{"class":600},[583,758,711],{"class":600},[583,760,762,765,767,769,772,774],{"class":585,"line":761},8,[583,763,764],{"class":697},"  fix",[583,766,701],{"class":600},[583,768,667],{"class":600},[583,770,771],{"class":615},"Try a different payment method or contact your bank",[583,773,612],{"class":600},[583,775,711],{"class":600},[583,777,779,782,784,786,789,791],{"class":585,"line":778},9,[583,780,781],{"class":697},"  link",[583,783,701],{"class":600},[583,785,667],{"class":600},[583,787,788],{"class":615},"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined",[583,790,612],{"class":600},[583,792,711],{"class":600},[583,794,796,799],{"class":585,"line":795},10,[583,797,798],{"class":600},"}",[583,800,621],{"class":608},[573,802,807],{"className":803,"code":804,"filename":805,"language":806,"meta":579,"style":579},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"statusCode\": 402,\n  \"message\": \"Payment failed\",\n  \"data\": {\n    \"code\": \"PAYMENT_DECLINED\",\n    \"why\": \"Card declined by issuer (insufficient funds)\",\n    \"fix\": \"Try a different payment method or contact your bank\",\n    \"link\": \"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined\"\n  }\n}\n","Response","json",[464,808,809,813,831,850,864,884,902,920,937,942],{"__ignoreMap":579},[583,810,811],{"class":585,"line":586},[583,812,691],{"class":600},[583,814,815,818,822,825,827,829],{"class":585,"line":593},[583,816,817],{"class":600},"  \"",[583,819,821],{"class":820},"spNyl","statusCode",[583,823,824],{"class":600},"\"",[583,826,701],{"class":600},[583,828,739],{"class":738},[583,830,711],{"class":600},[583,832,833,835,837,839,841,844,846,848],{"class":585,"line":682},[583,834,817],{"class":600},[583,836,505],{"class":820},[583,838,824],{"class":600},[583,840,701],{"class":600},[583,842,843],{"class":600}," \"",[583,845,616],{"class":615},[583,847,824],{"class":600},[583,849,711],{"class":600},[583,851,852,854,857,859,861],{"class":585,"line":694},[583,853,817],{"class":600},[583,855,856],{"class":820},"data",[583,858,824],{"class":600},[583,860,701],{"class":600},[583,862,863],{"class":600}," {\n",[583,865,866,869,872,874,876,878,880,882],{"class":585,"line":714},[583,867,868],{"class":600},"    \"",[583,870,464],{"class":871},"sBMFI",[583,873,824],{"class":600},[583,875,701],{"class":600},[583,877,843],{"class":600},[583,879,706],{"class":615},[583,881,824],{"class":600},[583,883,711],{"class":600},[583,885,886,888,890,892,894,896,898,900],{"class":585,"line":730},[583,887,868],{"class":600},[583,889,509],{"class":871},[583,891,824],{"class":600},[583,893,701],{"class":600},[583,895,843],{"class":600},[583,897,754],{"class":615},[583,899,824],{"class":600},[583,901,711],{"class":600},[583,903,904,906,908,910,912,914,916,918],{"class":585,"line":744},[583,905,868],{"class":600},[583,907,513],{"class":871},[583,909,824],{"class":600},[583,911,701],{"class":600},[583,913,843],{"class":600},[583,915,771],{"class":615},[583,917,824],{"class":600},[583,919,711],{"class":600},[583,921,922,924,926,928,930,932,934],{"class":585,"line":761},[583,923,868],{"class":600},[583,925,517],{"class":871},[583,927,824],{"class":600},[583,929,701],{"class":600},[583,931,843],{"class":600},[583,933,788],{"class":615},[583,935,936],{"class":600},"\"\n",[583,938,939],{"class":585,"line":778},[583,940,941],{"class":600},"  }\n",[583,943,944],{"class":585,"line":795},[583,945,946],{"class":600},"}\n",[562,948,950],{"id":949},"error-fields","Error Fields",[952,953,954,970],"table",{},[955,956,957],"thead",{},[958,959,960,964,967],"tr",{},[961,962,963],"th",{},"Field",[961,965,966],{},"Required",[961,968,969],{},"Description",[971,972,973,986,1001,1012,1023,1034,1045,1057],"tbody",{},[958,974,975,980,983],{},[976,977,978],"td",{},[464,979,505],{},[976,981,982],{},"Yes",[976,984,985],{},"What happened (shown to users)",[958,987,988,992,995],{},[976,989,990],{},[464,991,464],{},[976,993,994],{},"No",[976,996,997,998,1000],{},"Stable machine-readable identifier for client branching (e.g. ",[464,999,495],{},")",[958,1002,1003,1007,1009],{},[976,1004,1005],{},[464,1006,524],{},[976,1008,994],{},[976,1010,1011],{},"HTTP status code (default: 500)",[958,1013,1014,1018,1020],{},[976,1015,1016],{},[464,1017,509],{},[976,1019,994],{},[976,1021,1022],{},"Technical reason (for debugging)",[958,1024,1025,1029,1031],{},[976,1026,1027],{},[464,1028,513],{},[976,1030,994],{},[976,1032,1033],{},"Actionable solution",[958,1035,1036,1040,1042],{},[976,1037,1038],{},[464,1039,517],{},[976,1041,994],{},[976,1043,1044],{},"Documentation URL",[958,1046,1047,1052,1054],{},[976,1048,1049],{},[464,1050,1051],{},"cause",[976,1053,994],{},[976,1055,1056],{},"Original error (for error chaining)",[958,1058,1059,1064,1066],{},[976,1060,1061],{},[464,1062,1063],{},"internal",[976,1065,994],{},[976,1067,1068],{},"Backend-only context (see below)",[562,1070,1072,1073,1000],{"id":1071},"backend-only-context-internal","Backend-only context (",[464,1074,1063],{},[460,1076,489,1077,1079,1080,1084,1085,1088],{},[464,1078,1063],{}," when you need extra fields for logs, drains, or support tools, but ",[1081,1082,1083],"strong",{},"must not"," expose them in API responses or to ",[464,1086,1087],{},"parseError()"," on the client.",[573,1090,1092],{"className":575,"code":1091,"language":578,"meta":579,"style":579},"throw createError({\n  message: 'Payment could not be completed',\n  status: 402,\n  why: 'Your card was declined',\n  fix: 'Try another payment method',\n  internal: {\n    correlationId: 'pay_8x2k',\n    processorCode: 'insufficient_funds',\n    rawIssuerResponse: '…', \u002F\u002F never sent to the client\n  },\n})\n",[464,1093,1094,1104,1119,1129,1144,1159,1168,1184,1200,1220,1225],{"__ignoreMap":579},[583,1095,1096,1098,1100,1102],{"class":585,"line":586},[583,1097,597],{"class":596},[583,1099,658],{"class":604},[583,1101,609],{"class":608},[583,1103,691],{"class":600},[583,1105,1106,1108,1110,1112,1115,1117],{"class":585,"line":593},[583,1107,717],{"class":697},[583,1109,701],{"class":600},[583,1111,667],{"class":600},[583,1113,1114],{"class":615},"Payment could not be completed",[583,1116,612],{"class":600},[583,1118,711],{"class":600},[583,1120,1121,1123,1125,1127],{"class":585,"line":682},[583,1122,733],{"class":697},[583,1124,701],{"class":600},[583,1126,739],{"class":738},[583,1128,711],{"class":600},[583,1130,1131,1133,1135,1137,1140,1142],{"class":585,"line":694},[583,1132,747],{"class":697},[583,1134,701],{"class":600},[583,1136,667],{"class":600},[583,1138,1139],{"class":615},"Your card was declined",[583,1141,612],{"class":600},[583,1143,711],{"class":600},[583,1145,1146,1148,1150,1152,1155,1157],{"class":585,"line":714},[583,1147,764],{"class":697},[583,1149,701],{"class":600},[583,1151,667],{"class":600},[583,1153,1154],{"class":615},"Try another payment method",[583,1156,612],{"class":600},[583,1158,711],{"class":600},[583,1160,1161,1164,1166],{"class":585,"line":730},[583,1162,1163],{"class":697},"  internal",[583,1165,701],{"class":600},[583,1167,863],{"class":600},[583,1169,1170,1173,1175,1177,1180,1182],{"class":585,"line":744},[583,1171,1172],{"class":697},"    correlationId",[583,1174,701],{"class":600},[583,1176,667],{"class":600},[583,1178,1179],{"class":615},"pay_8x2k",[583,1181,612],{"class":600},[583,1183,711],{"class":600},[583,1185,1186,1189,1191,1193,1196,1198],{"class":585,"line":761},[583,1187,1188],{"class":697},"    processorCode",[583,1190,701],{"class":600},[583,1192,667],{"class":600},[583,1194,1195],{"class":615},"insufficient_funds",[583,1197,612],{"class":600},[583,1199,711],{"class":600},[583,1201,1202,1205,1207,1209,1212,1214,1217],{"class":585,"line":778},[583,1203,1204],{"class":697},"    rawIssuerResponse",[583,1206,701],{"class":600},[583,1208,667],{"class":600},[583,1210,1211],{"class":615},"…",[583,1213,612],{"class":600},[583,1215,1216],{"class":600},",",[583,1218,1219],{"class":589}," \u002F\u002F never sent to the client\n",[583,1221,1222],{"class":585,"line":795},[583,1223,1224],{"class":600},"  },\n",[583,1226,1228,1230],{"class":585,"line":1227},11,[583,1229,798],{"class":600},[583,1231,621],{"class":608},[477,1233,1234,1248,1262],{},[480,1235,1236,1239,1240,1245,1246,636],{},[1081,1237,1238],{},"HTTP responses"," (Nuxt\u002FNitro error handler, Next.js, SvelteKit, etc.) and ",[1081,1241,1242],{},[464,1243,1244],{},"toJSON()"," omit ",[464,1247,1063],{},[480,1249,1250,1254,1255,1257,1258,1261],{},[1081,1251,1252],{},[464,1253,1087],{}," does not surface ",[464,1256,1063],{}," for UI; the thrown error may still carry it server-side on ",[464,1259,1260],{},"raw"," when debugging.",[480,1263,1264,1267,1268,1271,1272,1275,1276,636],{},[1081,1265,1266],{},"Wide events",": when the framework records the error (e.g. ",[464,1269,1270],{},"log.error(err)"," or automatic capture on thrown ",[464,1273,1274],{},"EvlogError","), the emitted payload includes ",[464,1277,1278],{},"error.internal",[460,1280,1281,1282,636],{},"In debuggers, the payload may appear under a symbol key; in code, always use ",[1081,1283,1284],{},[464,1285,1278],{},[562,1287,1289],{"id":1288},"basic-usage","Basic Usage",[1291,1292,1294],"h3",{"id":1293},"simple-error","Simple Error",[641,1296,1297,1367],{},[573,1298,1301],{"className":575,"code":1299,"filename":1300,"language":578,"meta":579,"style":579},"import { createError } from 'evlog'\n\nthrow createError({\n  message: 'User not found',\n  status: 404,\n})\n","server\u002Fapi\u002Fusers\u002F[id].get.ts",[464,1302,1303,1321,1325,1335,1350,1361],{"__ignoreMap":579},[583,1304,1305,1307,1309,1311,1313,1315,1317,1319],{"class":585,"line":586},[583,1306,652],{"class":596},[583,1308,655],{"class":600},[583,1310,658],{"class":608},[583,1312,661],{"class":600},[583,1314,664],{"class":596},[583,1316,667],{"class":600},[583,1318,670],{"class":615},[583,1320,673],{"class":600},[583,1322,1323],{"class":585,"line":593},[583,1324,679],{"emptyLinePlaceholder":678},[583,1326,1327,1329,1331,1333],{"class":585,"line":682},[583,1328,597],{"class":596},[583,1330,658],{"class":604},[583,1332,609],{"class":608},[583,1334,691],{"class":600},[583,1336,1337,1339,1341,1343,1346,1348],{"class":585,"line":694},[583,1338,717],{"class":697},[583,1340,701],{"class":600},[583,1342,667],{"class":600},[583,1344,1345],{"class":615},"User not found",[583,1347,612],{"class":600},[583,1349,711],{"class":600},[583,1351,1352,1354,1356,1359],{"class":585,"line":714},[583,1353,733],{"class":697},[583,1355,701],{"class":600},[583,1357,1358],{"class":738}," 404",[583,1360,711],{"class":600},[583,1362,1363,1365],{"class":585,"line":730},[583,1364,798],{"class":600},[583,1366,621],{"class":608},[573,1368,1370],{"className":803,"code":1369,"filename":805,"language":806,"meta":579,"style":579},"{\n  \"statusCode\": 404,\n  \"message\": \"User not found\"\n}\n",[464,1371,1372,1376,1390,1406],{"__ignoreMap":579},[583,1373,1374],{"class":585,"line":586},[583,1375,691],{"class":600},[583,1377,1378,1380,1382,1384,1386,1388],{"class":585,"line":593},[583,1379,817],{"class":600},[583,1381,821],{"class":820},[583,1383,824],{"class":600},[583,1385,701],{"class":600},[583,1387,1358],{"class":738},[583,1389,711],{"class":600},[583,1391,1392,1394,1396,1398,1400,1402,1404],{"class":585,"line":682},[583,1393,817],{"class":600},[583,1395,505],{"class":820},[583,1397,824],{"class":600},[583,1399,701],{"class":600},[583,1401,843],{"class":600},[583,1403,1345],{"class":615},[583,1405,936],{"class":600},[583,1407,1408],{"class":585,"line":694},[583,1409,946],{"class":600},[1291,1411,1413],{"id":1412},"error-with-full-context","Error with Full Context",[641,1415,1416,1541],{},[573,1417,1419],{"className":575,"code":1418,"filename":577,"language":578,"meta":579,"style":579},"import { createError } from 'evlog'\n\nthrow createError({\n  code: 'PAYMENT_DECLINED',\n  message: 'Payment failed',\n  status: 402,\n  why: 'Card declined by issuer',\n  fix: 'Try a different payment method',\n  link: 'https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined',\n})\n",[464,1420,1421,1439,1443,1453,1467,1481,1491,1506,1521,1535],{"__ignoreMap":579},[583,1422,1423,1425,1427,1429,1431,1433,1435,1437],{"class":585,"line":586},[583,1424,652],{"class":596},[583,1426,655],{"class":600},[583,1428,658],{"class":608},[583,1430,661],{"class":600},[583,1432,664],{"class":596},[583,1434,667],{"class":600},[583,1436,670],{"class":615},[583,1438,673],{"class":600},[583,1440,1441],{"class":585,"line":593},[583,1442,679],{"emptyLinePlaceholder":678},[583,1444,1445,1447,1449,1451],{"class":585,"line":682},[583,1446,597],{"class":596},[583,1448,658],{"class":604},[583,1450,609],{"class":608},[583,1452,691],{"class":600},[583,1454,1455,1457,1459,1461,1463,1465],{"class":585,"line":694},[583,1456,698],{"class":697},[583,1458,701],{"class":600},[583,1460,667],{"class":600},[583,1462,706],{"class":615},[583,1464,612],{"class":600},[583,1466,711],{"class":600},[583,1468,1469,1471,1473,1475,1477,1479],{"class":585,"line":714},[583,1470,717],{"class":697},[583,1472,701],{"class":600},[583,1474,667],{"class":600},[583,1476,616],{"class":615},[583,1478,612],{"class":600},[583,1480,711],{"class":600},[583,1482,1483,1485,1487,1489],{"class":585,"line":730},[583,1484,733],{"class":697},[583,1486,701],{"class":600},[583,1488,739],{"class":738},[583,1490,711],{"class":600},[583,1492,1493,1495,1497,1499,1502,1504],{"class":585,"line":744},[583,1494,747],{"class":697},[583,1496,701],{"class":600},[583,1498,667],{"class":600},[583,1500,1501],{"class":615},"Card declined by issuer",[583,1503,612],{"class":600},[583,1505,711],{"class":600},[583,1507,1508,1510,1512,1514,1517,1519],{"class":585,"line":761},[583,1509,764],{"class":697},[583,1511,701],{"class":600},[583,1513,667],{"class":600},[583,1515,1516],{"class":615},"Try a different payment method",[583,1518,612],{"class":600},[583,1520,711],{"class":600},[583,1522,1523,1525,1527,1529,1531,1533],{"class":585,"line":778},[583,1524,781],{"class":697},[583,1526,701],{"class":600},[583,1528,667],{"class":600},[583,1530,788],{"class":615},[583,1532,612],{"class":600},[583,1534,711],{"class":600},[583,1536,1537,1539],{"class":585,"line":795},[583,1538,798],{"class":600},[583,1540,621],{"class":608},[573,1542,1544],{"className":803,"code":1543,"filename":805,"language":806,"meta":579,"style":579},"{\n  \"statusCode\": 402,\n  \"message\": \"Payment failed\",\n  \"data\": {\n    \"code\": \"PAYMENT_DECLINED\",\n    \"why\": \"Card declined by issuer\",\n    \"fix\": \"Try a different payment method\",\n    \"link\": \"https:\u002F\u002Fdocs.example.com\u002Fpayments\u002Fdeclined\"\n  }\n}\n",[464,1545,1546,1550,1564,1582,1594,1612,1630,1648,1664,1668],{"__ignoreMap":579},[583,1547,1548],{"class":585,"line":586},[583,1549,691],{"class":600},[583,1551,1552,1554,1556,1558,1560,1562],{"class":585,"line":593},[583,1553,817],{"class":600},[583,1555,821],{"class":820},[583,1557,824],{"class":600},[583,1559,701],{"class":600},[583,1561,739],{"class":738},[583,1563,711],{"class":600},[583,1565,1566,1568,1570,1572,1574,1576,1578,1580],{"class":585,"line":682},[583,1567,817],{"class":600},[583,1569,505],{"class":820},[583,1571,824],{"class":600},[583,1573,701],{"class":600},[583,1575,843],{"class":600},[583,1577,616],{"class":615},[583,1579,824],{"class":600},[583,1581,711],{"class":600},[583,1583,1584,1586,1588,1590,1592],{"class":585,"line":694},[583,1585,817],{"class":600},[583,1587,856],{"class":820},[583,1589,824],{"class":600},[583,1591,701],{"class":600},[583,1593,863],{"class":600},[583,1595,1596,1598,1600,1602,1604,1606,1608,1610],{"class":585,"line":714},[583,1597,868],{"class":600},[583,1599,464],{"class":871},[583,1601,824],{"class":600},[583,1603,701],{"class":600},[583,1605,843],{"class":600},[583,1607,706],{"class":615},[583,1609,824],{"class":600},[583,1611,711],{"class":600},[583,1613,1614,1616,1618,1620,1622,1624,1626,1628],{"class":585,"line":730},[583,1615,868],{"class":600},[583,1617,509],{"class":871},[583,1619,824],{"class":600},[583,1621,701],{"class":600},[583,1623,843],{"class":600},[583,1625,1501],{"class":615},[583,1627,824],{"class":600},[583,1629,711],{"class":600},[583,1631,1632,1634,1636,1638,1640,1642,1644,1646],{"class":585,"line":744},[583,1633,868],{"class":600},[583,1635,513],{"class":871},[583,1637,824],{"class":600},[583,1639,701],{"class":600},[583,1641,843],{"class":600},[583,1643,1516],{"class":615},[583,1645,824],{"class":600},[583,1647,711],{"class":600},[583,1649,1650,1652,1654,1656,1658,1660,1662],{"class":585,"line":761},[583,1651,868],{"class":600},[583,1653,517],{"class":871},[583,1655,824],{"class":600},[583,1657,701],{"class":600},[583,1659,843],{"class":600},[583,1661,788],{"class":615},[583,1663,936],{"class":600},[583,1665,1666],{"class":585,"line":778},[583,1667,941],{"class":600},[583,1669,1670],{"class":585,"line":795},[583,1671,946],{"class":600},[1291,1673,1675],{"id":1674},"error-chaining","Error Chaining",[460,1677,1678],{},"Wrap underlying errors while preserving the original:",[573,1680,1682],{"className":575,"code":1681,"filename":577,"language":578,"meta":579,"style":579},"import { createError } from 'evlog'\n\ntry {\n  await stripe.charges.create(charge)\n} catch (err) {\n  throw createError({\n    message: 'Payment processing failed',\n    status: 500,\n    why: 'Stripe API returned an error',\n    cause: err, \u002F\u002F Original error preserved\n  })\n}\n",[464,1683,1684,1702,1706,1713,1738,1750,1761,1777,1789,1805,1820,1827],{"__ignoreMap":579},[583,1685,1686,1688,1690,1692,1694,1696,1698,1700],{"class":585,"line":586},[583,1687,652],{"class":596},[583,1689,655],{"class":600},[583,1691,658],{"class":608},[583,1693,661],{"class":600},[583,1695,664],{"class":596},[583,1697,667],{"class":600},[583,1699,670],{"class":615},[583,1701,673],{"class":600},[583,1703,1704],{"class":585,"line":593},[583,1705,679],{"emptyLinePlaceholder":678},[583,1707,1708,1711],{"class":585,"line":682},[583,1709,1710],{"class":596},"try",[583,1712,863],{"class":600},[583,1714,1715,1718,1721,1723,1726,1728,1731,1733,1736],{"class":585,"line":694},[583,1716,1717],{"class":596},"  await",[583,1719,1720],{"class":608}," stripe",[583,1722,636],{"class":600},[583,1724,1725],{"class":608},"charges",[583,1727,636],{"class":600},[583,1729,1730],{"class":604},"create",[583,1732,609],{"class":697},[583,1734,1735],{"class":608},"charge",[583,1737,621],{"class":697},[583,1739,1740,1742,1745,1748],{"class":585,"line":714},[583,1741,798],{"class":600},[583,1743,1744],{"class":596}," catch",[583,1746,1747],{"class":608}," (err) ",[583,1749,691],{"class":600},[583,1751,1752,1755,1757,1759],{"class":585,"line":730},[583,1753,1754],{"class":596},"  throw",[583,1756,658],{"class":604},[583,1758,609],{"class":697},[583,1760,691],{"class":600},[583,1762,1763,1766,1768,1770,1773,1775],{"class":585,"line":744},[583,1764,1765],{"class":697},"    message",[583,1767,701],{"class":600},[583,1769,667],{"class":600},[583,1771,1772],{"class":615},"Payment processing failed",[583,1774,612],{"class":600},[583,1776,711],{"class":600},[583,1778,1779,1782,1784,1787],{"class":585,"line":761},[583,1780,1781],{"class":697},"    status",[583,1783,701],{"class":600},[583,1785,1786],{"class":738}," 500",[583,1788,711],{"class":600},[583,1790,1791,1794,1796,1798,1801,1803],{"class":585,"line":778},[583,1792,1793],{"class":697},"    why",[583,1795,701],{"class":600},[583,1797,667],{"class":600},[583,1799,1800],{"class":615},"Stripe API returned an error",[583,1802,612],{"class":600},[583,1804,711],{"class":600},[583,1806,1807,1810,1812,1815,1817],{"class":585,"line":795},[583,1808,1809],{"class":697},"    cause",[583,1811,701],{"class":600},[583,1813,1814],{"class":608}," err",[583,1816,1216],{"class":600},[583,1818,1819],{"class":589}," \u002F\u002F Original error preserved\n",[583,1821,1822,1825],{"class":585,"line":1227},[583,1823,1824],{"class":600},"  }",[583,1826,621],{"class":697},[583,1828,1830],{"class":585,"line":1829},12,[583,1831,946],{"class":600},[562,1833,1835,1836],{"id":1834},"branching-on-code","Branching on ",[464,1837,464],{},[460,1839,1840,1842,1843,1845],{},[464,1841,464],{}," is a stable, machine-readable identifier you control. Pair it with ",[464,1844,1087],{}," so the client can branch on logic without parsing user-facing messages or coupling to HTTP status codes.",[1847,1848],"structured-error-branching",{},[573,1850,1853],{"className":575,"code":1851,"filename":1852,"language":578,"meta":579,"style":579},"import { parseError } from 'evlog'\n\ntry {\n  await $fetch('\u002Fapi\u002Fcheckout', { method: 'POST', body: cart })\n} catch (err) {\n  const error = parseError(err)\n\n  switch (error.code) {\n    case 'PAYMENT_DECLINED':\n      return showRetryWithDifferentCard()\n    case 'CART_EXPIRED':\n      return rebuildCart()\n    default:\n      return toast.add({ title: error.message, color: 'error' })\n  }\n}\n","composables\u002FuseCheckout.ts",[464,1854,1855,1874,1878,1884,1930,1940,1960,1964,1984,1998,2009,2022,2031,2039,2085,2090],{"__ignoreMap":579},[583,1856,1857,1859,1861,1864,1866,1868,1870,1872],{"class":585,"line":586},[583,1858,652],{"class":596},[583,1860,655],{"class":600},[583,1862,1863],{"class":608}," parseError",[583,1865,661],{"class":600},[583,1867,664],{"class":596},[583,1869,667],{"class":600},[583,1871,670],{"class":615},[583,1873,673],{"class":600},[583,1875,1876],{"class":585,"line":593},[583,1877,679],{"emptyLinePlaceholder":678},[583,1879,1880,1882],{"class":585,"line":682},[583,1881,1710],{"class":596},[583,1883,863],{"class":600},[583,1885,1886,1888,1891,1893,1895,1898,1900,1902,1904,1907,1909,1911,1914,1916,1918,1921,1923,1926,1928],{"class":585,"line":694},[583,1887,1717],{"class":596},[583,1889,1890],{"class":604}," $fetch",[583,1892,609],{"class":697},[583,1894,612],{"class":600},[583,1896,1897],{"class":615},"\u002Fapi\u002Fcheckout",[583,1899,612],{"class":600},[583,1901,1216],{"class":600},[583,1903,655],{"class":600},[583,1905,1906],{"class":697}," method",[583,1908,701],{"class":600},[583,1910,667],{"class":600},[583,1912,1913],{"class":615},"POST",[583,1915,612],{"class":600},[583,1917,1216],{"class":600},[583,1919,1920],{"class":697}," body",[583,1922,701],{"class":600},[583,1924,1925],{"class":608}," cart",[583,1927,661],{"class":600},[583,1929,621],{"class":697},[583,1931,1932,1934,1936,1938],{"class":585,"line":714},[583,1933,798],{"class":600},[583,1935,1744],{"class":596},[583,1937,1747],{"class":608},[583,1939,691],{"class":600},[583,1941,1942,1945,1948,1951,1953,1955,1958],{"class":585,"line":730},[583,1943,1944],{"class":820},"  const",[583,1946,1947],{"class":608}," error",[583,1949,1950],{"class":600}," =",[583,1952,1863],{"class":604},[583,1954,609],{"class":697},[583,1956,1957],{"class":608},"err",[583,1959,621],{"class":697},[583,1961,1962],{"class":585,"line":744},[583,1963,679],{"emptyLinePlaceholder":678},[583,1965,1966,1969,1972,1975,1977,1979,1982],{"class":585,"line":761},[583,1967,1968],{"class":596},"  switch",[583,1970,1971],{"class":697}," (",[583,1973,1974],{"class":608},"error",[583,1976,636],{"class":600},[583,1978,464],{"class":608},[583,1980,1981],{"class":697},") ",[583,1983,691],{"class":600},[583,1985,1986,1989,1991,1993,1995],{"class":585,"line":778},[583,1987,1988],{"class":596},"    case",[583,1990,667],{"class":600},[583,1992,706],{"class":615},[583,1994,612],{"class":600},[583,1996,1997],{"class":600},":\n",[583,1999,2000,2003,2006],{"class":585,"line":795},[583,2001,2002],{"class":596},"      return",[583,2004,2005],{"class":604}," showRetryWithDifferentCard",[583,2007,2008],{"class":697},"()\n",[583,2010,2011,2013,2015,2018,2020],{"class":585,"line":1227},[583,2012,1988],{"class":596},[583,2014,667],{"class":600},[583,2016,2017],{"class":615},"CART_EXPIRED",[583,2019,612],{"class":600},[583,2021,1997],{"class":600},[583,2023,2024,2026,2029],{"class":585,"line":1829},[583,2025,2002],{"class":596},[583,2027,2028],{"class":604}," rebuildCart",[583,2030,2008],{"class":697},[583,2032,2034,2037],{"class":585,"line":2033},13,[583,2035,2036],{"class":596},"    default",[583,2038,1997],{"class":600},[583,2040,2042,2044,2047,2049,2052,2054,2057,2060,2062,2064,2066,2068,2070,2073,2075,2077,2079,2081,2083],{"class":585,"line":2041},14,[583,2043,2002],{"class":596},[583,2045,2046],{"class":608}," toast",[583,2048,636],{"class":600},[583,2050,2051],{"class":604},"add",[583,2053,609],{"class":697},[583,2055,2056],{"class":600},"{",[583,2058,2059],{"class":697}," title",[583,2061,701],{"class":600},[583,2063,1947],{"class":608},[583,2065,636],{"class":600},[583,2067,505],{"class":608},[583,2069,1216],{"class":600},[583,2071,2072],{"class":697}," color",[583,2074,701],{"class":600},[583,2076,667],{"class":600},[583,2078,1974],{"class":615},[583,2080,612],{"class":600},[583,2082,661],{"class":600},[583,2084,621],{"class":697},[583,2086,2088],{"class":585,"line":2087},15,[583,2089,941],{"class":600},[583,2091,2093],{"class":585,"line":2092},16,[583,2094,946],{"class":600},[460,2096,2097,2099,2100,2102,2103,496,2106,2109,2110,2113,2114,2117],{},[464,2098,1087],{}," also surfaces ",[464,2101,464],{}," from Node-style errors (e.g. ",[464,2104,2105],{},"'ENOENT'",[464,2107,2108],{},"'ECONNRESET'",") and any ",[464,2111,2112],{},"Error"," instance with a string ",[464,2115,2116],{},".code"," property, so existing system errors flow through the same branch.",[460,2119,2120,2122,2123,2126],{},[464,2121,464],{}," is also copied onto wide events under ",[464,2124,2125],{},"error.code",", so dashboards and drains can group, alert, and chart by code without parsing free-text messages.",[562,2128,2130],{"id":2129},"frontend-error-handling","Frontend Error Handling",[460,2132,489,2133,2135],{},[464,2134,1087],{}," to extract all fields from caught errors:",[641,2137,2138,2356],{},[573,2139,2141],{"className":575,"code":2140,"filename":1852,"language":578,"meta":579,"style":579},"import { parseError } from 'evlog'\n\ntry {\n  await $fetch('\u002Fapi\u002Fcheckout', { method: 'POST', body: cart })\n} catch (err) {\n  const error = parseError(err)\n\n  console.log(error.message)  \u002F\u002F \"Payment failed\"\n  console.log(error.status)   \u002F\u002F 402\n  console.log(error.code)     \u002F\u002F \"PAYMENT_DECLINED\"\n  console.log(error.why)      \u002F\u002F \"Card declined\"\n  console.log(error.fix)      \u002F\u002F \"Try another card\"\n}\n",[464,2142,2143,2161,2165,2171,2211,2221,2237,2241,2265,2287,2309,2331,2352],{"__ignoreMap":579},[583,2144,2145,2147,2149,2151,2153,2155,2157,2159],{"class":585,"line":586},[583,2146,652],{"class":596},[583,2148,655],{"class":600},[583,2150,1863],{"class":608},[583,2152,661],{"class":600},[583,2154,664],{"class":596},[583,2156,667],{"class":600},[583,2158,670],{"class":615},[583,2160,673],{"class":600},[583,2162,2163],{"class":585,"line":593},[583,2164,679],{"emptyLinePlaceholder":678},[583,2166,2167,2169],{"class":585,"line":682},[583,2168,1710],{"class":596},[583,2170,863],{"class":600},[583,2172,2173,2175,2177,2179,2181,2183,2185,2187,2189,2191,2193,2195,2197,2199,2201,2203,2205,2207,2209],{"class":585,"line":694},[583,2174,1717],{"class":596},[583,2176,1890],{"class":604},[583,2178,609],{"class":697},[583,2180,612],{"class":600},[583,2182,1897],{"class":615},[583,2184,612],{"class":600},[583,2186,1216],{"class":600},[583,2188,655],{"class":600},[583,2190,1906],{"class":697},[583,2192,701],{"class":600},[583,2194,667],{"class":600},[583,2196,1913],{"class":615},[583,2198,612],{"class":600},[583,2200,1216],{"class":600},[583,2202,1920],{"class":697},[583,2204,701],{"class":600},[583,2206,1925],{"class":608},[583,2208,661],{"class":600},[583,2210,621],{"class":697},[583,2212,2213,2215,2217,2219],{"class":585,"line":714},[583,2214,798],{"class":600},[583,2216,1744],{"class":596},[583,2218,1747],{"class":608},[583,2220,691],{"class":600},[583,2222,2223,2225,2227,2229,2231,2233,2235],{"class":585,"line":730},[583,2224,1944],{"class":820},[583,2226,1947],{"class":608},[583,2228,1950],{"class":600},[583,2230,1863],{"class":604},[583,2232,609],{"class":697},[583,2234,1957],{"class":608},[583,2236,621],{"class":697},[583,2238,2239],{"class":585,"line":744},[583,2240,679],{"emptyLinePlaceholder":678},[583,2242,2243,2246,2248,2251,2253,2255,2257,2259,2262],{"class":585,"line":761},[583,2244,2245],{"class":608},"  console",[583,2247,636],{"class":600},[583,2249,2250],{"class":604},"log",[583,2252,609],{"class":697},[583,2254,1974],{"class":608},[583,2256,636],{"class":600},[583,2258,505],{"class":608},[583,2260,2261],{"class":697},")  ",[583,2263,2264],{"class":589},"\u002F\u002F \"Payment failed\"\n",[583,2266,2267,2269,2271,2273,2275,2277,2279,2281,2284],{"class":585,"line":778},[583,2268,2245],{"class":608},[583,2270,636],{"class":600},[583,2272,2250],{"class":604},[583,2274,609],{"class":697},[583,2276,1974],{"class":608},[583,2278,636],{"class":600},[583,2280,524],{"class":608},[583,2282,2283],{"class":697},")   ",[583,2285,2286],{"class":589},"\u002F\u002F 402\n",[583,2288,2289,2291,2293,2295,2297,2299,2301,2303,2306],{"class":585,"line":795},[583,2290,2245],{"class":608},[583,2292,636],{"class":600},[583,2294,2250],{"class":604},[583,2296,609],{"class":697},[583,2298,1974],{"class":608},[583,2300,636],{"class":600},[583,2302,464],{"class":608},[583,2304,2305],{"class":697},")     ",[583,2307,2308],{"class":589},"\u002F\u002F \"PAYMENT_DECLINED\"\n",[583,2310,2311,2313,2315,2317,2319,2321,2323,2325,2328],{"class":585,"line":1227},[583,2312,2245],{"class":608},[583,2314,636],{"class":600},[583,2316,2250],{"class":604},[583,2318,609],{"class":697},[583,2320,1974],{"class":608},[583,2322,636],{"class":600},[583,2324,509],{"class":608},[583,2326,2327],{"class":697},")      ",[583,2329,2330],{"class":589},"\u002F\u002F \"Card declined\"\n",[583,2332,2333,2335,2337,2339,2341,2343,2345,2347,2349],{"class":585,"line":1829},[583,2334,2245],{"class":608},[583,2336,636],{"class":600},[583,2338,2250],{"class":604},[583,2340,609],{"class":697},[583,2342,1974],{"class":608},[583,2344,636],{"class":600},[583,2346,513],{"class":608},[583,2348,2327],{"class":697},[583,2350,2351],{"class":589},"\u002F\u002F \"Try another card\"\n",[583,2353,2354],{"class":585,"line":2033},[583,2355,946],{"class":600},[573,2357,2360],{"className":575,"code":2358,"filename":2359,"language":578,"meta":579,"style":579},"import { parseError } from 'evlog'\n\nconst toast = useToast()\n\ntry {\n  await $fetch('\u002Fapi\u002Fcheckout', { method: 'POST', body: cart })\n} catch (err) {\n  const error = parseError(err)\n\n  toast.add({\n    title: error.message,\n    description: error.why,\n    color: 'error',\n    actions: error.link\n      ? [{ label: 'Learn more', onClick: () => window.open(error.link) }]\n      : undefined,\n  })\n}\n","composables\u002FuseCheckout.ts (Nuxt UI)",[464,2361,2362,2380,2384,2400,2404,2410,2450,2460,2476,2480,2493,2508,2523,2538,2552,2610,2618,2625],{"__ignoreMap":579},[583,2363,2364,2366,2368,2370,2372,2374,2376,2378],{"class":585,"line":586},[583,2365,652],{"class":596},[583,2367,655],{"class":600},[583,2369,1863],{"class":608},[583,2371,661],{"class":600},[583,2373,664],{"class":596},[583,2375,667],{"class":600},[583,2377,670],{"class":615},[583,2379,673],{"class":600},[583,2381,2382],{"class":585,"line":593},[583,2383,679],{"emptyLinePlaceholder":678},[583,2385,2386,2389,2392,2395,2398],{"class":585,"line":682},[583,2387,2388],{"class":820},"const",[583,2390,2391],{"class":608}," toast ",[583,2393,2394],{"class":600},"=",[583,2396,2397],{"class":604}," useToast",[583,2399,2008],{"class":608},[583,2401,2402],{"class":585,"line":694},[583,2403,679],{"emptyLinePlaceholder":678},[583,2405,2406,2408],{"class":585,"line":714},[583,2407,1710],{"class":596},[583,2409,863],{"class":600},[583,2411,2412,2414,2416,2418,2420,2422,2424,2426,2428,2430,2432,2434,2436,2438,2440,2442,2444,2446,2448],{"class":585,"line":730},[583,2413,1717],{"class":596},[583,2415,1890],{"class":604},[583,2417,609],{"class":697},[583,2419,612],{"class":600},[583,2421,1897],{"class":615},[583,2423,612],{"class":600},[583,2425,1216],{"class":600},[583,2427,655],{"class":600},[583,2429,1906],{"class":697},[583,2431,701],{"class":600},[583,2433,667],{"class":600},[583,2435,1913],{"class":615},[583,2437,612],{"class":600},[583,2439,1216],{"class":600},[583,2441,1920],{"class":697},[583,2443,701],{"class":600},[583,2445,1925],{"class":608},[583,2447,661],{"class":600},[583,2449,621],{"class":697},[583,2451,2452,2454,2456,2458],{"class":585,"line":744},[583,2453,798],{"class":600},[583,2455,1744],{"class":596},[583,2457,1747],{"class":608},[583,2459,691],{"class":600},[583,2461,2462,2464,2466,2468,2470,2472,2474],{"class":585,"line":761},[583,2463,1944],{"class":820},[583,2465,1947],{"class":608},[583,2467,1950],{"class":600},[583,2469,1863],{"class":604},[583,2471,609],{"class":697},[583,2473,1957],{"class":608},[583,2475,621],{"class":697},[583,2477,2478],{"class":585,"line":778},[583,2479,679],{"emptyLinePlaceholder":678},[583,2481,2482,2485,2487,2489,2491],{"class":585,"line":795},[583,2483,2484],{"class":608},"  toast",[583,2486,636],{"class":600},[583,2488,2051],{"class":604},[583,2490,609],{"class":697},[583,2492,691],{"class":600},[583,2494,2495,2498,2500,2502,2504,2506],{"class":585,"line":1227},[583,2496,2497],{"class":697},"    title",[583,2499,701],{"class":600},[583,2501,1947],{"class":608},[583,2503,636],{"class":600},[583,2505,505],{"class":608},[583,2507,711],{"class":600},[583,2509,2510,2513,2515,2517,2519,2521],{"class":585,"line":1829},[583,2511,2512],{"class":697},"    description",[583,2514,701],{"class":600},[583,2516,1947],{"class":608},[583,2518,636],{"class":600},[583,2520,509],{"class":608},[583,2522,711],{"class":600},[583,2524,2525,2528,2530,2532,2534,2536],{"class":585,"line":2033},[583,2526,2527],{"class":697},"    color",[583,2529,701],{"class":600},[583,2531,667],{"class":600},[583,2533,1974],{"class":615},[583,2535,612],{"class":600},[583,2537,711],{"class":600},[583,2539,2540,2543,2545,2547,2549],{"class":585,"line":2041},[583,2541,2542],{"class":697},"    actions",[583,2544,701],{"class":600},[583,2546,1947],{"class":608},[583,2548,636],{"class":600},[583,2550,2551],{"class":608},"link\n",[583,2553,2554,2557,2560,2562,2565,2567,2569,2572,2574,2576,2579,2581,2584,2587,2590,2592,2595,2597,2599,2601,2603,2605,2607],{"class":585,"line":2087},[583,2555,2556],{"class":600},"      ?",[583,2558,2559],{"class":697}," [",[583,2561,2056],{"class":600},[583,2563,2564],{"class":697}," label",[583,2566,701],{"class":600},[583,2568,667],{"class":600},[583,2570,2571],{"class":615},"Learn more",[583,2573,612],{"class":600},[583,2575,1216],{"class":600},[583,2577,2578],{"class":604}," onClick",[583,2580,701],{"class":600},[583,2582,2583],{"class":600}," ()",[583,2585,2586],{"class":820}," =>",[583,2588,2589],{"class":608}," window",[583,2591,636],{"class":600},[583,2593,2594],{"class":604},"open",[583,2596,609],{"class":697},[583,2598,1974],{"class":608},[583,2600,636],{"class":600},[583,2602,517],{"class":608},[583,2604,1981],{"class":697},[583,2606,798],{"class":600},[583,2608,2609],{"class":697},"]\n",[583,2611,2612,2615],{"class":585,"line":2092},[583,2613,2614],{"class":600},"      :",[583,2616,2617],{"class":600}," undefined,\n",[583,2619,2621,2623],{"class":585,"line":2620},17,[583,2622,1824],{"class":600},[583,2624,621],{"class":697},[583,2626,2628],{"class":585,"line":2627},18,[583,2629,946],{"class":600},[1291,2631,2633],{"id":2632},"error-display-component","Error Display Component",[460,2635,2636],{},"Create a reusable error display:",[573,2638,2643],{"className":2639,"code":2640,"filename":2641,"language":2642,"meta":579,"style":579},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup lang=\"ts\">\nimport { parseError } from 'evlog'\n\nconst { error } = defineProps\u003C{\n  error: unknown\n}>()\n\nconst parsed = computed(() => parseError(error))\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003CUAlert\n    :title=\"parsed.message\"\n    :description=\"parsed.why\"\n    color=\"error\"\n    icon=\"i-lucide-alert-circle\"\n  >\n    \u003Ctemplate v-if=\"parsed.fix\" #description>\n      \u003Cp>{{ parsed.why }}\u003C\u002Fp>\n      \u003Cp class=\"mt-2 font-medium\">{{ parsed.fix }}\u003C\u002Fp>\n    \u003C\u002Ftemplate>\n  \u003C\u002FUAlert>\n\u003C\u002Ftemplate>\n","components\u002FErrorAlert.vue","vue",[464,2644,2645,2671,2689,2693,2712,2722,2729,2733,2757,2766,2770,2779,2787,2801,2815,2827,2841,2846,2877,2897,2927,2937,2948],{"__ignoreMap":579},[583,2646,2647,2650,2653,2656,2659,2661,2663,2666,2668],{"class":585,"line":586},[583,2648,2649],{"class":600},"\u003C",[583,2651,2652],{"class":697},"script",[583,2654,2655],{"class":820}," setup",[583,2657,2658],{"class":820}," lang",[583,2660,2394],{"class":600},[583,2662,824],{"class":600},[583,2664,2665],{"class":615},"ts",[583,2667,824],{"class":600},[583,2669,2670],{"class":600},">\n",[583,2672,2673,2675,2677,2679,2681,2683,2685,2687],{"class":585,"line":593},[583,2674,652],{"class":596},[583,2676,655],{"class":600},[583,2678,1863],{"class":608},[583,2680,661],{"class":600},[583,2682,664],{"class":596},[583,2684,667],{"class":600},[583,2686,670],{"class":615},[583,2688,673],{"class":600},[583,2690,2691],{"class":585,"line":682},[583,2692,679],{"emptyLinePlaceholder":678},[583,2694,2695,2697,2699,2702,2704,2706,2709],{"class":585,"line":694},[583,2696,2388],{"class":820},[583,2698,655],{"class":600},[583,2700,2701],{"class":608}," error ",[583,2703,798],{"class":600},[583,2705,1950],{"class":600},[583,2707,2708],{"class":604}," defineProps",[583,2710,2711],{"class":600},"\u003C{\n",[583,2713,2714,2717,2719],{"class":585,"line":714},[583,2715,2716],{"class":697},"  error",[583,2718,701],{"class":600},[583,2720,2721],{"class":871}," unknown\n",[583,2723,2724,2727],{"class":585,"line":730},[583,2725,2726],{"class":600},"}>",[583,2728,2008],{"class":608},[583,2730,2731],{"class":585,"line":744},[583,2732,679],{"emptyLinePlaceholder":678},[583,2734,2735,2737,2740,2742,2745,2747,2750,2752,2754],{"class":585,"line":761},[583,2736,2388],{"class":820},[583,2738,2739],{"class":608}," parsed ",[583,2741,2394],{"class":600},[583,2743,2744],{"class":604}," computed",[583,2746,609],{"class":608},[583,2748,2749],{"class":600},"()",[583,2751,2586],{"class":820},[583,2753,1863],{"class":604},[583,2755,2756],{"class":608},"(error))\n",[583,2758,2759,2762,2764],{"class":585,"line":778},[583,2760,2761],{"class":600},"\u003C\u002F",[583,2763,2652],{"class":697},[583,2765,2670],{"class":600},[583,2767,2768],{"class":585,"line":795},[583,2769,679],{"emptyLinePlaceholder":678},[583,2771,2772,2774,2777],{"class":585,"line":1227},[583,2773,2649],{"class":600},[583,2775,2776],{"class":697},"template",[583,2778,2670],{"class":600},[583,2780,2781,2784],{"class":585,"line":1829},[583,2782,2783],{"class":600},"  \u003C",[583,2785,2786],{"class":697},"UAlert\n",[583,2788,2789,2792,2794,2796,2799],{"class":585,"line":2033},[583,2790,2791],{"class":820},"    :title",[583,2793,2394],{"class":600},[583,2795,824],{"class":600},[583,2797,2798],{"class":615},"parsed.message",[583,2800,936],{"class":600},[583,2802,2803,2806,2808,2810,2813],{"class":585,"line":2041},[583,2804,2805],{"class":820},"    :description",[583,2807,2394],{"class":600},[583,2809,824],{"class":600},[583,2811,2812],{"class":615},"parsed.why",[583,2814,936],{"class":600},[583,2816,2817,2819,2821,2823,2825],{"class":585,"line":2087},[583,2818,2527],{"class":820},[583,2820,2394],{"class":600},[583,2822,824],{"class":600},[583,2824,1974],{"class":615},[583,2826,936],{"class":600},[583,2828,2829,2832,2834,2836,2839],{"class":585,"line":2092},[583,2830,2831],{"class":820},"    icon",[583,2833,2394],{"class":600},[583,2835,824],{"class":600},[583,2837,2838],{"class":615},"i-lucide-alert-circle",[583,2840,936],{"class":600},[583,2842,2843],{"class":585,"line":2620},[583,2844,2845],{"class":600},"  >\n",[583,2847,2848,2851,2853,2856,2858,2860,2863,2865,2867,2869,2872,2875],{"class":585,"line":2627},[583,2849,2850],{"class":600},"    \u003C",[583,2852,2776],{"class":697},[583,2854,2855],{"class":596}," v-if",[583,2857,2394],{"class":600},[583,2859,824],{"class":600},[583,2861,2862],{"class":608},"parsed",[583,2864,636],{"class":600},[583,2866,513],{"class":608},[583,2868,824],{"class":600},[583,2870,2871],{"class":600}," #",[583,2873,2874],{"class":820},"description",[583,2876,2670],{"class":600},[583,2878,2880,2883,2885,2888,2891,2893,2895],{"class":585,"line":2879},19,[583,2881,2882],{"class":600},"      \u003C",[583,2884,460],{"class":697},[583,2886,2887],{"class":600},">",[583,2889,2890],{"class":608},"{{ parsed.why }}",[583,2892,2761],{"class":600},[583,2894,460],{"class":697},[583,2896,2670],{"class":600},[583,2898,2900,2902,2904,2907,2909,2911,2914,2916,2918,2921,2923,2925],{"class":585,"line":2899},20,[583,2901,2882],{"class":600},[583,2903,460],{"class":697},[583,2905,2906],{"class":820}," class",[583,2908,2394],{"class":600},[583,2910,824],{"class":600},[583,2912,2913],{"class":615},"mt-2 font-medium",[583,2915,824],{"class":600},[583,2917,2887],{"class":600},[583,2919,2920],{"class":608},"{{ parsed.fix }}",[583,2922,2761],{"class":600},[583,2924,460],{"class":697},[583,2926,2670],{"class":600},[583,2928,2930,2933,2935],{"class":585,"line":2929},21,[583,2931,2932],{"class":600},"    \u003C\u002F",[583,2934,2776],{"class":697},[583,2936,2670],{"class":600},[583,2938,2940,2943,2946],{"class":585,"line":2939},22,[583,2941,2942],{"class":600},"  \u003C\u002F",[583,2944,2945],{"class":697},"UAlert",[583,2947,2670],{"class":600},[583,2949,2951,2953,2955],{"class":585,"line":2950},23,[583,2952,2761],{"class":600},[583,2954,2776],{"class":697},[583,2956,2670],{"class":600},[562,2958,185],{"id":2959},"best-practices",[1291,2961,2963],{"id":2962},"use-appropriate-status-codes","Use Appropriate Status Codes",[641,2965,2966,3034,3117,3169],{},[573,2967,2970],{"className":575,"code":2968,"filename":2969,"language":578,"meta":579,"style":579},"\u002F\u002F Client error - user can fix\nthrow createError({\n  message: 'Invalid email format',\n  status: 400,\n  fix: 'Please enter a valid email address',\n})\n","400 - Bad Request",[464,2971,2972,2977,2987,3002,3013,3028],{"__ignoreMap":579},[583,2973,2974],{"class":585,"line":586},[583,2975,2976],{"class":589},"\u002F\u002F Client error - user can fix\n",[583,2978,2979,2981,2983,2985],{"class":585,"line":593},[583,2980,597],{"class":596},[583,2982,658],{"class":604},[583,2984,609],{"class":608},[583,2986,691],{"class":600},[583,2988,2989,2991,2993,2995,2998,3000],{"class":585,"line":682},[583,2990,717],{"class":697},[583,2992,701],{"class":600},[583,2994,667],{"class":600},[583,2996,2997],{"class":615},"Invalid email format",[583,2999,612],{"class":600},[583,3001,711],{"class":600},[583,3003,3004,3006,3008,3011],{"class":585,"line":694},[583,3005,733],{"class":697},[583,3007,701],{"class":600},[583,3009,3010],{"class":738}," 400",[583,3012,711],{"class":600},[583,3014,3015,3017,3019,3021,3024,3026],{"class":585,"line":714},[583,3016,764],{"class":697},[583,3018,701],{"class":600},[583,3020,667],{"class":600},[583,3022,3023],{"class":615},"Please enter a valid email address",[583,3025,612],{"class":600},[583,3027,711],{"class":600},[583,3029,3030,3032],{"class":585,"line":730},[583,3031,798],{"class":600},[583,3033,621],{"class":608},[573,3035,3038],{"className":575,"code":3036,"filename":3037,"language":578,"meta":579,"style":579},"\u002F\u002F Authentication required\nthrow createError({\n  message: 'Please log in to continue',\n  status: 401,\n  fix: 'Sign in to your account',\n  link: '\u002Flogin',\n})\n","401 - Unauthorized",[464,3039,3040,3045,3055,3070,3081,3096,3111],{"__ignoreMap":579},[583,3041,3042],{"class":585,"line":586},[583,3043,3044],{"class":589},"\u002F\u002F Authentication required\n",[583,3046,3047,3049,3051,3053],{"class":585,"line":593},[583,3048,597],{"class":596},[583,3050,658],{"class":604},[583,3052,609],{"class":608},[583,3054,691],{"class":600},[583,3056,3057,3059,3061,3063,3066,3068],{"class":585,"line":682},[583,3058,717],{"class":697},[583,3060,701],{"class":600},[583,3062,667],{"class":600},[583,3064,3065],{"class":615},"Please log in to continue",[583,3067,612],{"class":600},[583,3069,711],{"class":600},[583,3071,3072,3074,3076,3079],{"class":585,"line":694},[583,3073,733],{"class":697},[583,3075,701],{"class":600},[583,3077,3078],{"class":738}," 401",[583,3080,711],{"class":600},[583,3082,3083,3085,3087,3089,3092,3094],{"class":585,"line":714},[583,3084,764],{"class":697},[583,3086,701],{"class":600},[583,3088,667],{"class":600},[583,3090,3091],{"class":615},"Sign in to your account",[583,3093,612],{"class":600},[583,3095,711],{"class":600},[583,3097,3098,3100,3102,3104,3107,3109],{"class":585,"line":730},[583,3099,781],{"class":697},[583,3101,701],{"class":600},[583,3103,667],{"class":600},[583,3105,3106],{"class":615},"\u002Flogin",[583,3108,612],{"class":600},[583,3110,711],{"class":600},[583,3112,3113,3115],{"class":585,"line":744},[583,3114,798],{"class":600},[583,3116,621],{"class":608},[573,3118,3121],{"className":575,"code":3119,"filename":3120,"language":578,"meta":579,"style":579},"\u002F\u002F Resource not found\nthrow createError({\n  message: 'Order not found',\n  status: 404,\n})\n","404 - Not Found",[464,3122,3123,3128,3138,3153,3163],{"__ignoreMap":579},[583,3124,3125],{"class":585,"line":586},[583,3126,3127],{"class":589},"\u002F\u002F Resource not found\n",[583,3129,3130,3132,3134,3136],{"class":585,"line":593},[583,3131,597],{"class":596},[583,3133,658],{"class":604},[583,3135,609],{"class":608},[583,3137,691],{"class":600},[583,3139,3140,3142,3144,3146,3149,3151],{"class":585,"line":682},[583,3141,717],{"class":697},[583,3143,701],{"class":600},[583,3145,667],{"class":600},[583,3147,3148],{"class":615},"Order not found",[583,3150,612],{"class":600},[583,3152,711],{"class":600},[583,3154,3155,3157,3159,3161],{"class":585,"line":694},[583,3156,733],{"class":697},[583,3158,701],{"class":600},[583,3160,1358],{"class":738},[583,3162,711],{"class":600},[583,3164,3165,3167],{"class":585,"line":714},[583,3166,798],{"class":600},[583,3168,621],{"class":608},[573,3170,3173],{"className":575,"code":3171,"filename":3172,"language":578,"meta":579,"style":579},"\u002F\u002F Server error - not user's fault\nthrow createError({\n  message: 'Something went wrong',\n  status: 500,\n  why: 'Database connection timeout',\n  \u002F\u002F No 'fix' - user can't fix server errors\n})\n","500 - Server Error",[464,3174,3175,3180,3190,3205,3215,3230,3235],{"__ignoreMap":579},[583,3176,3177],{"class":585,"line":586},[583,3178,3179],{"class":589},"\u002F\u002F Server error - not user's fault\n",[583,3181,3182,3184,3186,3188],{"class":585,"line":593},[583,3183,597],{"class":596},[583,3185,658],{"class":604},[583,3187,609],{"class":608},[583,3189,691],{"class":600},[583,3191,3192,3194,3196,3198,3201,3203],{"class":585,"line":682},[583,3193,717],{"class":697},[583,3195,701],{"class":600},[583,3197,667],{"class":600},[583,3199,3200],{"class":615},"Something went wrong",[583,3202,612],{"class":600},[583,3204,711],{"class":600},[583,3206,3207,3209,3211,3213],{"class":585,"line":694},[583,3208,733],{"class":697},[583,3210,701],{"class":600},[583,3212,1786],{"class":738},[583,3214,711],{"class":600},[583,3216,3217,3219,3221,3223,3226,3228],{"class":585,"line":714},[583,3218,747],{"class":697},[583,3220,701],{"class":600},[583,3222,667],{"class":600},[583,3224,3225],{"class":615},"Database connection timeout",[583,3227,612],{"class":600},[583,3229,711],{"class":600},[583,3231,3232],{"class":585,"line":730},[583,3233,3234],{"class":589},"  \u002F\u002F No 'fix' - user can't fix server errors\n",[583,3236,3237,3239],{"class":585,"line":744},[583,3238,798],{"class":600},[583,3240,621],{"class":608},[1291,3242,3244],{"id":3243},"provide-actionable-fixes","Provide Actionable Fixes",[641,3246,3247,3304],{},[573,3248,3251],{"className":575,"code":3249,"filename":3250,"language":578,"meta":579,"style":579},"\u002F\u002F Unhelpful fix\nthrow createError({\n  message: 'Upload failed',\n  fix: 'Try again',\n})\n","Bad",[464,3252,3253,3258,3268,3283,3298],{"__ignoreMap":579},[583,3254,3255],{"class":585,"line":586},[583,3256,3257],{"class":589},"\u002F\u002F Unhelpful fix\n",[583,3259,3260,3262,3264,3266],{"class":585,"line":593},[583,3261,597],{"class":596},[583,3263,658],{"class":604},[583,3265,609],{"class":608},[583,3267,691],{"class":600},[583,3269,3270,3272,3274,3276,3279,3281],{"class":585,"line":682},[583,3271,717],{"class":697},[583,3273,701],{"class":600},[583,3275,667],{"class":600},[583,3277,3278],{"class":615},"Upload failed",[583,3280,612],{"class":600},[583,3282,711],{"class":600},[583,3284,3285,3287,3289,3291,3294,3296],{"class":585,"line":694},[583,3286,764],{"class":697},[583,3288,701],{"class":600},[583,3290,667],{"class":600},[583,3292,3293],{"class":615},"Try again",[583,3295,612],{"class":600},[583,3297,711],{"class":600},[583,3299,3300,3302],{"class":585,"line":714},[583,3301,798],{"class":600},[583,3303,621],{"class":608},[573,3305,3308],{"className":575,"code":3306,"filename":3307,"language":578,"meta":579,"style":579},"\u002F\u002F Actionable fix\nthrow createError({\n  message: 'Upload failed',\n  status: 413,\n  why: 'File exceeds maximum size (10MB)',\n  fix: 'Reduce the file size or compress the image before uploading',\n  link: '\u002Fdocs\u002Fupload-limits',\n})\n","Good",[464,3309,3310,3315,3325,3339,3350,3365,3380,3395],{"__ignoreMap":579},[583,3311,3312],{"class":585,"line":586},[583,3313,3314],{"class":589},"\u002F\u002F Actionable fix\n",[583,3316,3317,3319,3321,3323],{"class":585,"line":593},[583,3318,597],{"class":596},[583,3320,658],{"class":604},[583,3322,609],{"class":608},[583,3324,691],{"class":600},[583,3326,3327,3329,3331,3333,3335,3337],{"class":585,"line":682},[583,3328,717],{"class":697},[583,3330,701],{"class":600},[583,3332,667],{"class":600},[583,3334,3278],{"class":615},[583,3336,612],{"class":600},[583,3338,711],{"class":600},[583,3340,3341,3343,3345,3348],{"class":585,"line":694},[583,3342,733],{"class":697},[583,3344,701],{"class":600},[583,3346,3347],{"class":738}," 413",[583,3349,711],{"class":600},[583,3351,3352,3354,3356,3358,3361,3363],{"class":585,"line":714},[583,3353,747],{"class":697},[583,3355,701],{"class":600},[583,3357,667],{"class":600},[583,3359,3360],{"class":615},"File exceeds maximum size (10MB)",[583,3362,612],{"class":600},[583,3364,711],{"class":600},[583,3366,3367,3369,3371,3373,3376,3378],{"class":585,"line":730},[583,3368,764],{"class":697},[583,3370,701],{"class":600},[583,3372,667],{"class":600},[583,3374,3375],{"class":615},"Reduce the file size or compress the image before uploading",[583,3377,612],{"class":600},[583,3379,711],{"class":600},[583,3381,3382,3384,3386,3388,3391,3393],{"class":585,"line":744},[583,3383,781],{"class":697},[583,3385,701],{"class":600},[583,3387,667],{"class":600},[583,3389,3390],{"class":615},"\u002Fdocs\u002Fupload-limits",[583,3392,612],{"class":600},[583,3394,711],{"class":600},[583,3396,3397,3399],{"class":585,"line":761},[583,3398,798],{"class":600},[583,3400,621],{"class":608},[562,3402,3404],{"id":3403},"error-catalogs","Error Catalogs",[460,3406,3407,3408,3411,3412,3415,3416,3419,3420,3422,3423,3426,3427,3429],{},"For anything beyond a handful of one-off errors, group them in a typed ",[1081,3409,3410],{},"catalog",". evlog ships two primitives for this — ",[464,3413,3414],{},"defineError"," (single factory) and ",[464,3417,3418],{},"defineErrorCatalog"," (bundle prefixed). The wire ",[464,3421,464],{}," is auto-derived as ",[464,3424,3425],{},"${prefix}.${KEY}"," and the ",[464,3428,1274],{}," instance is built with all defaults applied.",[1291,3431,3433],{"id":3432},"defineerrorcatalog",[464,3434,3418],{},[460,3436,3437,3438,3441,3442,3445],{},"Define a bundle of errors that share a prefix. Convention: ",[464,3439,3440],{},"UPPER_SNAKE_CASE"," keys, ",[464,3443,3444],{},"lower.dot.case"," prefix.",[641,3447,3448,3748],{},[573,3449,3452],{"className":575,"code":3450,"filename":3451,"language":578,"meta":579,"style":579},"import { defineErrorCatalog } from 'evlog'\n\nexport const billingErrors = defineErrorCatalog('billing', {\n  CART_EMPTY: {\n    status: 400,\n    message: 'Cart is empty',\n  },\n  PAYMENT_DECLINED: {\n    status: 402,\n    message: 'Card declined',\n    why: 'Issuer declined the charge',\n    fix: 'Try a different payment method',\n    link: 'https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined',\n  },\n  INSUFFICIENT_FUNDS: {\n    status: 402,\n    message: ({ available, required }: { available: number, required: number }) =>\n      `Insufficient funds: $${available} available, $${required} required`,\n    fix: 'Add funds and retry',\n  },\n})\n","errors\u002Fbilling.ts",[464,3453,3454,3473,3477,3505,3514,3524,3539,3543,3552,3562,3577,3592,3607,3623,3627,3636,3646,3690,3723,3738,3742],{"__ignoreMap":579},[583,3455,3456,3458,3460,3463,3465,3467,3469,3471],{"class":585,"line":586},[583,3457,652],{"class":596},[583,3459,655],{"class":600},[583,3461,3462],{"class":608}," defineErrorCatalog",[583,3464,661],{"class":600},[583,3466,664],{"class":596},[583,3468,667],{"class":600},[583,3470,670],{"class":615},[583,3472,673],{"class":600},[583,3474,3475],{"class":585,"line":593},[583,3476,679],{"emptyLinePlaceholder":678},[583,3478,3479,3482,3485,3488,3490,3492,3494,3496,3499,3501,3503],{"class":585,"line":682},[583,3480,3481],{"class":596},"export",[583,3483,3484],{"class":820}," const",[583,3486,3487],{"class":608}," billingErrors ",[583,3489,2394],{"class":600},[583,3491,3462],{"class":604},[583,3493,609],{"class":608},[583,3495,612],{"class":600},[583,3497,3498],{"class":615},"billing",[583,3500,612],{"class":600},[583,3502,1216],{"class":600},[583,3504,863],{"class":600},[583,3506,3507,3510,3512],{"class":585,"line":694},[583,3508,3509],{"class":697},"  CART_EMPTY",[583,3511,701],{"class":600},[583,3513,863],{"class":600},[583,3515,3516,3518,3520,3522],{"class":585,"line":714},[583,3517,1781],{"class":697},[583,3519,701],{"class":600},[583,3521,3010],{"class":738},[583,3523,711],{"class":600},[583,3525,3526,3528,3530,3532,3535,3537],{"class":585,"line":730},[583,3527,1765],{"class":697},[583,3529,701],{"class":600},[583,3531,667],{"class":600},[583,3533,3534],{"class":615},"Cart is empty",[583,3536,612],{"class":600},[583,3538,711],{"class":600},[583,3540,3541],{"class":585,"line":744},[583,3542,1224],{"class":600},[583,3544,3545,3548,3550],{"class":585,"line":761},[583,3546,3547],{"class":697},"  PAYMENT_DECLINED",[583,3549,701],{"class":600},[583,3551,863],{"class":600},[583,3553,3554,3556,3558,3560],{"class":585,"line":778},[583,3555,1781],{"class":697},[583,3557,701],{"class":600},[583,3559,739],{"class":738},[583,3561,711],{"class":600},[583,3563,3564,3566,3568,3570,3573,3575],{"class":585,"line":795},[583,3565,1765],{"class":697},[583,3567,701],{"class":600},[583,3569,667],{"class":600},[583,3571,3572],{"class":615},"Card declined",[583,3574,612],{"class":600},[583,3576,711],{"class":600},[583,3578,3579,3581,3583,3585,3588,3590],{"class":585,"line":1227},[583,3580,1793],{"class":697},[583,3582,701],{"class":600},[583,3584,667],{"class":600},[583,3586,3587],{"class":615},"Issuer declined the charge",[583,3589,612],{"class":600},[583,3591,711],{"class":600},[583,3593,3594,3597,3599,3601,3603,3605],{"class":585,"line":1829},[583,3595,3596],{"class":697},"    fix",[583,3598,701],{"class":600},[583,3600,667],{"class":600},[583,3602,1516],{"class":615},[583,3604,612],{"class":600},[583,3606,711],{"class":600},[583,3608,3609,3612,3614,3616,3619,3621],{"class":585,"line":2033},[583,3610,3611],{"class":697},"    link",[583,3613,701],{"class":600},[583,3615,667],{"class":600},[583,3617,3618],{"class":615},"https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined",[583,3620,612],{"class":600},[583,3622,711],{"class":600},[583,3624,3625],{"class":585,"line":2041},[583,3626,1224],{"class":600},[583,3628,3629,3632,3634],{"class":585,"line":2087},[583,3630,3631],{"class":697},"  INSUFFICIENT_FUNDS",[583,3633,701],{"class":600},[583,3635,863],{"class":600},[583,3637,3638,3640,3642,3644],{"class":585,"line":2092},[583,3639,1781],{"class":697},[583,3641,701],{"class":600},[583,3643,739],{"class":738},[583,3645,711],{"class":600},[583,3647,3648,3650,3652,3655,3659,3661,3664,3667,3669,3671,3673,3676,3678,3680,3682,3684,3687],{"class":585,"line":2620},[583,3649,1765],{"class":604},[583,3651,701],{"class":600},[583,3653,3654],{"class":600}," ({",[583,3656,3658],{"class":3657},"sHdIc"," available",[583,3660,1216],{"class":600},[583,3662,3663],{"class":3657}," required",[583,3665,3666],{"class":600}," }:",[583,3668,655],{"class":600},[583,3670,3658],{"class":697},[583,3672,701],{"class":600},[583,3674,3675],{"class":871}," number",[583,3677,1216],{"class":600},[583,3679,3663],{"class":697},[583,3681,701],{"class":600},[583,3683,3675],{"class":871},[583,3685,3686],{"class":600}," })",[583,3688,3689],{"class":820}," =>\n",[583,3691,3692,3695,3698,3701,3704,3706,3709,3711,3714,3716,3718,3721],{"class":585,"line":2627},[583,3693,3694],{"class":600},"      `",[583,3696,3697],{"class":615},"Insufficient funds: $",[583,3699,3700],{"class":600},"${",[583,3702,3703],{"class":608},"available",[583,3705,798],{"class":600},[583,3707,3708],{"class":615}," available, $",[583,3710,3700],{"class":600},[583,3712,3713],{"class":608},"required",[583,3715,798],{"class":600},[583,3717,3663],{"class":615},[583,3719,3720],{"class":600},"`",[583,3722,711],{"class":600},[583,3724,3725,3727,3729,3731,3734,3736],{"class":585,"line":2879},[583,3726,3596],{"class":697},[583,3728,701],{"class":600},[583,3730,667],{"class":600},[583,3732,3733],{"class":615},"Add funds and retry",[583,3735,612],{"class":600},[583,3737,711],{"class":600},[583,3739,3740],{"class":585,"line":2899},[583,3741,1224],{"class":600},[583,3743,3744,3746],{"class":585,"line":2929},[583,3745,798],{"class":600},[583,3747,621],{"class":608},[573,3749,3751],{"className":575,"code":3750,"filename":577,"language":578,"meta":579,"style":579},"import { billingErrors } from '~\u002Ferrors\u002Fbilling'\n\nexport default defineEventHandler(async (event) => {\n  const cart = await getCart(event)\n\n  if (!cart.items.length) throw billingErrors.CART_EMPTY()\n\n  try {\n    await stripe.charge(cart.total)\n  }\n  catch (e) {\n    if (e.code === 'card_declined') throw billingErrors.PAYMENT_DECLINED({ cause: e })\n    if (e.code === 'insufficient_funds') {\n      throw billingErrors.INSUFFICIENT_FUNDS({\n        available: e.balance,\n        required: cart.total,\n        cause: e,\n      })\n    }\n    throw e\n  }\n})\n",[464,3752,3753,3773,3777,3803,3823,3827,3863,3867,3874,3896,3900,3914,3963,3987,4003,4019,4034,4045,4052,4057,4065,4069],{"__ignoreMap":579},[583,3754,3755,3757,3759,3762,3764,3766,3768,3771],{"class":585,"line":586},[583,3756,652],{"class":596},[583,3758,655],{"class":600},[583,3760,3761],{"class":608}," billingErrors",[583,3763,661],{"class":600},[583,3765,664],{"class":596},[583,3767,667],{"class":600},[583,3769,3770],{"class":615},"~\u002Ferrors\u002Fbilling",[583,3772,673],{"class":600},[583,3774,3775],{"class":585,"line":593},[583,3776,679],{"emptyLinePlaceholder":678},[583,3778,3779,3781,3784,3787,3789,3792,3794,3797,3799,3801],{"class":585,"line":682},[583,3780,3481],{"class":596},[583,3782,3783],{"class":596}," default",[583,3785,3786],{"class":604}," defineEventHandler",[583,3788,609],{"class":608},[583,3790,3791],{"class":820},"async",[583,3793,1971],{"class":600},[583,3795,3796],{"class":3657},"event",[583,3798,1000],{"class":600},[583,3800,2586],{"class":820},[583,3802,863],{"class":600},[583,3804,3805,3807,3809,3811,3814,3817,3819,3821],{"class":585,"line":694},[583,3806,1944],{"class":820},[583,3808,1925],{"class":608},[583,3810,1950],{"class":600},[583,3812,3813],{"class":596}," await",[583,3815,3816],{"class":604}," getCart",[583,3818,609],{"class":697},[583,3820,3796],{"class":608},[583,3822,621],{"class":697},[583,3824,3825],{"class":585,"line":714},[583,3826,679],{"emptyLinePlaceholder":678},[583,3828,3829,3832,3834,3837,3840,3842,3845,3847,3850,3852,3854,3856,3858,3861],{"class":585,"line":730},[583,3830,3831],{"class":596},"  if",[583,3833,1971],{"class":697},[583,3835,3836],{"class":600},"!",[583,3838,3839],{"class":608},"cart",[583,3841,636],{"class":600},[583,3843,3844],{"class":608},"items",[583,3846,636],{"class":600},[583,3848,3849],{"class":608},"length",[583,3851,1981],{"class":697},[583,3853,597],{"class":596},[583,3855,3761],{"class":608},[583,3857,636],{"class":600},[583,3859,3860],{"class":604},"CART_EMPTY",[583,3862,2008],{"class":697},[583,3864,3865],{"class":585,"line":744},[583,3866,679],{"emptyLinePlaceholder":678},[583,3868,3869,3872],{"class":585,"line":761},[583,3870,3871],{"class":596},"  try",[583,3873,863],{"class":600},[583,3875,3876,3879,3881,3883,3885,3887,3889,3891,3894],{"class":585,"line":778},[583,3877,3878],{"class":596},"    await",[583,3880,1720],{"class":608},[583,3882,636],{"class":600},[583,3884,1735],{"class":604},[583,3886,609],{"class":697},[583,3888,3839],{"class":608},[583,3890,636],{"class":600},[583,3892,3893],{"class":608},"total",[583,3895,621],{"class":697},[583,3897,3898],{"class":585,"line":795},[583,3899,941],{"class":600},[583,3901,3902,3905,3907,3910,3912],{"class":585,"line":1227},[583,3903,3904],{"class":596},"  catch",[583,3906,1971],{"class":697},[583,3908,3909],{"class":608},"e",[583,3911,1981],{"class":697},[583,3913,691],{"class":600},[583,3915,3916,3919,3921,3923,3925,3927,3930,3932,3935,3937,3939,3941,3943,3945,3947,3949,3951,3954,3956,3959,3961],{"class":585,"line":1829},[583,3917,3918],{"class":596},"    if",[583,3920,1971],{"class":697},[583,3922,3909],{"class":608},[583,3924,636],{"class":600},[583,3926,464],{"class":608},[583,3928,3929],{"class":600}," ===",[583,3931,667],{"class":600},[583,3933,3934],{"class":615},"card_declined",[583,3936,612],{"class":600},[583,3938,1981],{"class":697},[583,3940,597],{"class":596},[583,3942,3761],{"class":608},[583,3944,636],{"class":600},[583,3946,706],{"class":604},[583,3948,609],{"class":697},[583,3950,2056],{"class":600},[583,3952,3953],{"class":697}," cause",[583,3955,701],{"class":600},[583,3957,3958],{"class":608}," e",[583,3960,661],{"class":600},[583,3962,621],{"class":697},[583,3964,3965,3967,3969,3971,3973,3975,3977,3979,3981,3983,3985],{"class":585,"line":2033},[583,3966,3918],{"class":596},[583,3968,1971],{"class":697},[583,3970,3909],{"class":608},[583,3972,636],{"class":600},[583,3974,464],{"class":608},[583,3976,3929],{"class":600},[583,3978,667],{"class":600},[583,3980,1195],{"class":615},[583,3982,612],{"class":600},[583,3984,1981],{"class":697},[583,3986,691],{"class":600},[583,3988,3989,3992,3994,3996,3999,4001],{"class":585,"line":2041},[583,3990,3991],{"class":596},"      throw",[583,3993,3761],{"class":608},[583,3995,636],{"class":600},[583,3997,3998],{"class":604},"INSUFFICIENT_FUNDS",[583,4000,609],{"class":697},[583,4002,691],{"class":600},[583,4004,4005,4008,4010,4012,4014,4017],{"class":585,"line":2087},[583,4006,4007],{"class":697},"        available",[583,4009,701],{"class":600},[583,4011,3958],{"class":608},[583,4013,636],{"class":600},[583,4015,4016],{"class":608},"balance",[583,4018,711],{"class":600},[583,4020,4021,4024,4026,4028,4030,4032],{"class":585,"line":2092},[583,4022,4023],{"class":697},"        required",[583,4025,701],{"class":600},[583,4027,1925],{"class":608},[583,4029,636],{"class":600},[583,4031,3893],{"class":608},[583,4033,711],{"class":600},[583,4035,4036,4039,4041,4043],{"class":585,"line":2620},[583,4037,4038],{"class":697},"        cause",[583,4040,701],{"class":600},[583,4042,3958],{"class":608},[583,4044,711],{"class":600},[583,4046,4047,4050],{"class":585,"line":2627},[583,4048,4049],{"class":600},"      }",[583,4051,621],{"class":697},[583,4053,4054],{"class":585,"line":2879},[583,4055,4056],{"class":600},"    }\n",[583,4058,4059,4062],{"class":585,"line":2899},[583,4060,4061],{"class":596},"    throw",[583,4063,4064],{"class":608}," e\n",[583,4066,4067],{"class":585,"line":2929},[583,4068,941],{"class":600},[583,4070,4071,4073],{"class":585,"line":2939},[583,4072,798],{"class":600},[583,4074,621],{"class":608},[460,4076,4077,4078,548,4081,4084,4085,4088],{},"Each entry becomes a typed factory. Catalog metadata is exposed on ",[464,4079,4080],{},"_codes",[464,4082,4083],{},"_prefix"," for introspection (non-enumerable so ",[464,4086,4087],{},"Object.keys(billingErrors)"," still returns just the entry names).",[573,4090,4092],{"className":575,"code":4091,"language":578,"meta":579,"style":579},"billingErrors.PAYMENT_DECLINED.code   \u002F\u002F 'billing.PAYMENT_DECLINED'\nbillingErrors.PAYMENT_DECLINED.status \u002F\u002F 402\nbillingErrors._codes\n\u002F\u002F readonly [\n\u002F\u002F   'billing.CART_EMPTY',\n\u002F\u002F   'billing.PAYMENT_DECLINED',\n\u002F\u002F   'billing.INSUFFICIENT_FUNDS',\n\u002F\u002F ]\n",[464,4093,4094,4111,4126,4135,4140,4145,4150,4155],{"__ignoreMap":579},[583,4095,4096,4099,4101,4103,4105,4108],{"class":585,"line":586},[583,4097,4098],{"class":608},"billingErrors",[583,4100,636],{"class":600},[583,4102,706],{"class":608},[583,4104,636],{"class":600},[583,4106,4107],{"class":608},"code   ",[583,4109,4110],{"class":589},"\u002F\u002F 'billing.PAYMENT_DECLINED'\n",[583,4112,4113,4115,4117,4119,4121,4124],{"class":585,"line":593},[583,4114,4098],{"class":608},[583,4116,636],{"class":600},[583,4118,706],{"class":608},[583,4120,636],{"class":600},[583,4122,4123],{"class":608},"status ",[583,4125,2286],{"class":589},[583,4127,4128,4130,4132],{"class":585,"line":682},[583,4129,4098],{"class":608},[583,4131,636],{"class":600},[583,4133,4134],{"class":608},"_codes\n",[583,4136,4137],{"class":585,"line":694},[583,4138,4139],{"class":589},"\u002F\u002F readonly [\n",[583,4141,4142],{"class":585,"line":714},[583,4143,4144],{"class":589},"\u002F\u002F   'billing.CART_EMPTY',\n",[583,4146,4147],{"class":585,"line":730},[583,4148,4149],{"class":589},"\u002F\u002F   'billing.PAYMENT_DECLINED',\n",[583,4151,4152],{"class":585,"line":744},[583,4153,4154],{"class":589},"\u002F\u002F   'billing.INSUFFICIENT_FUNDS',\n",[583,4156,4157],{"class":585,"line":761},[583,4158,4159],{"class":589},"\u002F\u002F ]\n",[1291,4161,4163],{"id":4162},"templated-messages-with-typed-params","Templated messages with typed params",[460,4165,4166,4167,4169,4170,4173],{},"Set ",[464,4168,505],{}," to a function and the params become ",[1081,4171,4172],{},"required and typed"," at the call site.",[573,4175,4177],{"className":575,"code":4176,"language":578,"meta":579,"style":579},"const InvoiceOverdue = defineError('billing.INVOICE_OVERDUE', {\n  status: 402,\n  message: ({ daysOverdue }: { daysOverdue: number }) =>\n    `Invoice overdue by ${daysOverdue} day(s)`,\n  fix: 'Pay outstanding invoice to resume service',\n})\n\nthrow InvoiceOverdue({ daysOverdue: 7 }) \u002F\u002F params required and type-checked\n",[464,4178,4179,4204,4214,4239,4261,4276,4282,4286],{"__ignoreMap":579},[583,4180,4181,4183,4186,4188,4191,4193,4195,4198,4200,4202],{"class":585,"line":586},[583,4182,2388],{"class":820},[583,4184,4185],{"class":608}," InvoiceOverdue ",[583,4187,2394],{"class":600},[583,4189,4190],{"class":604}," defineError",[583,4192,609],{"class":608},[583,4194,612],{"class":600},[583,4196,4197],{"class":615},"billing.INVOICE_OVERDUE",[583,4199,612],{"class":600},[583,4201,1216],{"class":600},[583,4203,863],{"class":600},[583,4205,4206,4208,4210,4212],{"class":585,"line":593},[583,4207,733],{"class":697},[583,4209,701],{"class":600},[583,4211,739],{"class":738},[583,4213,711],{"class":600},[583,4215,4216,4218,4220,4222,4225,4227,4229,4231,4233,4235,4237],{"class":585,"line":682},[583,4217,717],{"class":604},[583,4219,701],{"class":600},[583,4221,3654],{"class":600},[583,4223,4224],{"class":3657}," daysOverdue",[583,4226,3666],{"class":600},[583,4228,655],{"class":600},[583,4230,4224],{"class":697},[583,4232,701],{"class":600},[583,4234,3675],{"class":871},[583,4236,3686],{"class":600},[583,4238,3689],{"class":820},[583,4240,4241,4244,4247,4249,4252,4254,4257,4259],{"class":585,"line":694},[583,4242,4243],{"class":600},"    `",[583,4245,4246],{"class":615},"Invoice overdue by ",[583,4248,3700],{"class":600},[583,4250,4251],{"class":608},"daysOverdue",[583,4253,798],{"class":600},[583,4255,4256],{"class":615}," day(s)",[583,4258,3720],{"class":600},[583,4260,711],{"class":600},[583,4262,4263,4265,4267,4269,4272,4274],{"class":585,"line":714},[583,4264,764],{"class":697},[583,4266,701],{"class":600},[583,4268,667],{"class":600},[583,4270,4271],{"class":615},"Pay outstanding invoice to resume service",[583,4273,612],{"class":600},[583,4275,711],{"class":600},[583,4277,4278,4280],{"class":585,"line":730},[583,4279,798],{"class":600},[583,4281,621],{"class":608},[583,4283,4284],{"class":585,"line":744},[583,4285,679],{"emptyLinePlaceholder":678},[583,4287,4288,4290,4293,4295,4297,4299,4301,4304,4306,4308],{"class":585,"line":761},[583,4289,597],{"class":596},[583,4291,4292],{"class":604}," InvoiceOverdue",[583,4294,609],{"class":608},[583,4296,2056],{"class":600},[583,4298,4224],{"class":697},[583,4300,701],{"class":600},[583,4302,4303],{"class":738}," 7",[583,4305,661],{"class":600},[583,4307,1981],{"class":608},[583,4309,4310],{"class":589},"\u002F\u002F params required and type-checked\n",[460,4312,4313,4314,496,4316,496,4318,496,4320,496,4322,496,4324,496,4326,4328,4329,4331],{},"You can still override any field at the call site (",[464,4315,505],{},[464,4317,524],{},[464,4319,509],{},[464,4321,513],{},[464,4323,517],{},[464,4325,1063],{},[464,4327,1051],{},"). Catalog defaults for ",[464,4330,1063],{}," are shallow-merged with call-site values (call-site wins on conflict).",[1291,4333,4335,4337],{"id":4334},"defineerror-standalone-factories",[464,4336,3414],{}," — standalone factories",[460,4339,4340,4341,4343],{},"For one-off errors that don't fit a catalog (or for very large repos that prefer one file per error), use ",[464,4342,3414],{}," directly. Same factory shape as a catalog entry, no prefix derivation.",[573,4345,4347],{"className":575,"code":4346,"language":578,"meta":579,"style":579},"\u002F\u002F errors\u002FFraudDetected.ts\nimport { defineError } from 'evlog'\n\nexport const FraudDetected = defineError('billing.FRAUD_DETECTED', {\n  status: 403,\n  message: 'Transaction flagged for review',\n  why: 'ML fraud-score above threshold',\n  fix: 'Contact support to verify your identity',\n})\n\nthrow FraudDetected()\n",[464,4348,4349,4354,4372,4376,4402,4413,4428,4443,4458,4464,4468],{"__ignoreMap":579},[583,4350,4351],{"class":585,"line":586},[583,4352,4353],{"class":589},"\u002F\u002F errors\u002FFraudDetected.ts\n",[583,4355,4356,4358,4360,4362,4364,4366,4368,4370],{"class":585,"line":593},[583,4357,652],{"class":596},[583,4359,655],{"class":600},[583,4361,4190],{"class":608},[583,4363,661],{"class":600},[583,4365,664],{"class":596},[583,4367,667],{"class":600},[583,4369,670],{"class":615},[583,4371,673],{"class":600},[583,4373,4374],{"class":585,"line":682},[583,4375,679],{"emptyLinePlaceholder":678},[583,4377,4378,4380,4382,4385,4387,4389,4391,4393,4396,4398,4400],{"class":585,"line":694},[583,4379,3481],{"class":596},[583,4381,3484],{"class":820},[583,4383,4384],{"class":608}," FraudDetected ",[583,4386,2394],{"class":600},[583,4388,4190],{"class":604},[583,4390,609],{"class":608},[583,4392,612],{"class":600},[583,4394,4395],{"class":615},"billing.FRAUD_DETECTED",[583,4397,612],{"class":600},[583,4399,1216],{"class":600},[583,4401,863],{"class":600},[583,4403,4404,4406,4408,4411],{"class":585,"line":714},[583,4405,733],{"class":697},[583,4407,701],{"class":600},[583,4409,4410],{"class":738}," 403",[583,4412,711],{"class":600},[583,4414,4415,4417,4419,4421,4424,4426],{"class":585,"line":730},[583,4416,717],{"class":697},[583,4418,701],{"class":600},[583,4420,667],{"class":600},[583,4422,4423],{"class":615},"Transaction flagged for review",[583,4425,612],{"class":600},[583,4427,711],{"class":600},[583,4429,4430,4432,4434,4436,4439,4441],{"class":585,"line":744},[583,4431,747],{"class":697},[583,4433,701],{"class":600},[583,4435,667],{"class":600},[583,4437,4438],{"class":615},"ML fraud-score above threshold",[583,4440,612],{"class":600},[583,4442,711],{"class":600},[583,4444,4445,4447,4449,4451,4454,4456],{"class":585,"line":761},[583,4446,764],{"class":697},[583,4448,701],{"class":600},[583,4450,667],{"class":600},[583,4452,4453],{"class":615},"Contact support to verify your identity",[583,4455,612],{"class":600},[583,4457,711],{"class":600},[583,4459,4460,4462],{"class":585,"line":778},[583,4461,798],{"class":600},[583,4463,621],{"class":608},[583,4465,4466],{"class":585,"line":795},[583,4467,679],{"emptyLinePlaceholder":678},[583,4469,4470,4472,4475],{"class":585,"line":1227},[583,4471,597],{"class":596},[583,4473,4474],{"class":604}," FraudDetected",[583,4476,2008],{"class":608},[1291,4478,4480],{"id":4479},"type-safe-codes-everywhere-opt-in","Type-safe codes everywhere (opt-in)",[460,4482,4483,4484,4487,4488,496,4491,4494,4495,4497],{},"Augment the ",[464,4485,4486],{},"RegisteredErrorCatalogs"," interface to make every registered code surface as autocomplete on ",[464,4489,4490],{},"createError({ code })",[464,4492,4493],{},"parseError(err).code",", and any other typed ",[464,4496,464],{}," field across the codebase.",[641,4499,4500,4615],{},[573,4501,4504],{"className":575,"code":4502,"filename":4503,"language":578,"meta":579,"style":579},"import type { billingErrors } from '.\u002Fbilling'\nimport type { authErrors }    from '.\u002Fauth'\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    billing: typeof billingErrors\n    auth:    typeof authErrors\n  }\n}\n","errors\u002Ftypes.ts",[464,4505,4506,4528,4551,4555,4571,4581,4594,4607,4611],{"__ignoreMap":579},[583,4507,4508,4510,4513,4515,4517,4519,4521,4523,4526],{"class":585,"line":586},[583,4509,652],{"class":596},[583,4511,4512],{"class":596}," type",[583,4514,655],{"class":600},[583,4516,3761],{"class":608},[583,4518,661],{"class":600},[583,4520,664],{"class":596},[583,4522,667],{"class":600},[583,4524,4525],{"class":615},".\u002Fbilling",[583,4527,673],{"class":600},[583,4529,4530,4532,4534,4536,4539,4541,4544,4546,4549],{"class":585,"line":593},[583,4531,652],{"class":596},[583,4533,4512],{"class":596},[583,4535,655],{"class":600},[583,4537,4538],{"class":608}," authErrors",[583,4540,661],{"class":600},[583,4542,4543],{"class":596},"    from",[583,4545,667],{"class":600},[583,4547,4548],{"class":615},".\u002Fauth",[583,4550,673],{"class":600},[583,4552,4553],{"class":585,"line":682},[583,4554,679],{"emptyLinePlaceholder":678},[583,4556,4557,4560,4563,4565,4567,4569],{"class":585,"line":694},[583,4558,4559],{"class":820},"declare",[583,4561,4562],{"class":820}," module",[583,4564,667],{"class":600},[583,4566,670],{"class":615},[583,4568,612],{"class":600},[583,4570,863],{"class":600},[583,4572,4573,4576,4579],{"class":585,"line":714},[583,4574,4575],{"class":820},"  interface",[583,4577,4578],{"class":871}," RegisteredErrorCatalogs",[583,4580,863],{"class":600},[583,4582,4583,4586,4588,4591],{"class":585,"line":730},[583,4584,4585],{"class":697},"    billing",[583,4587,701],{"class":600},[583,4589,4590],{"class":600}," typeof",[583,4592,4593],{"class":608}," billingErrors\n",[583,4595,4596,4599,4601,4604],{"class":585,"line":744},[583,4597,4598],{"class":697},"    auth",[583,4600,701],{"class":600},[583,4602,4603],{"class":600},"    typeof",[583,4605,4606],{"class":608}," authErrors\n",[583,4608,4609],{"class":585,"line":761},[583,4610,941],{"class":600},[583,4612,4613],{"class":585,"line":778},[583,4614,946],{"class":600},[573,4616,4619],{"className":575,"code":4617,"filename":4618,"language":578,"meta":579,"style":579},"\u002F\u002F createError autocompletes registered codes (and still accepts ad-hoc strings)\nthrow createError({\n  code: 'billing.PAYMENT_DECLINED', \u002F\u002F ← autocomplete, TS error if typo\n  message: 'Card declined',\n  status: 402,\n})\n\n\u002F\u002F parseError().code is typed as the union of all registered codes\nconst err = parseError(caught)\nif (err.code === 'billing.PAYMENT_DECLINED') retry()\n\u002F\u002F                ↑ autocomplete, refactor-safe\n","Anywhere in your codebase",[464,4620,4621,4626,4636,4654,4668,4678,4684,4688,4693,4707,4736],{"__ignoreMap":579},[583,4622,4623],{"class":585,"line":586},[583,4624,4625],{"class":589},"\u002F\u002F createError autocompletes registered codes (and still accepts ad-hoc strings)\n",[583,4627,4628,4630,4632,4634],{"class":585,"line":593},[583,4629,597],{"class":596},[583,4631,658],{"class":604},[583,4633,609],{"class":608},[583,4635,691],{"class":600},[583,4637,4638,4640,4642,4644,4647,4649,4651],{"class":585,"line":682},[583,4639,698],{"class":697},[583,4641,701],{"class":600},[583,4643,667],{"class":600},[583,4645,4646],{"class":615},"billing.PAYMENT_DECLINED",[583,4648,612],{"class":600},[583,4650,1216],{"class":600},[583,4652,4653],{"class":589}," \u002F\u002F ← autocomplete, TS error if typo\n",[583,4655,4656,4658,4660,4662,4664,4666],{"class":585,"line":694},[583,4657,717],{"class":697},[583,4659,701],{"class":600},[583,4661,667],{"class":600},[583,4663,3572],{"class":615},[583,4665,612],{"class":600},[583,4667,711],{"class":600},[583,4669,4670,4672,4674,4676],{"class":585,"line":714},[583,4671,733],{"class":697},[583,4673,701],{"class":600},[583,4675,739],{"class":738},[583,4677,711],{"class":600},[583,4679,4680,4682],{"class":585,"line":730},[583,4681,798],{"class":600},[583,4683,621],{"class":608},[583,4685,4686],{"class":585,"line":744},[583,4687,679],{"emptyLinePlaceholder":678},[583,4689,4690],{"class":585,"line":761},[583,4691,4692],{"class":589},"\u002F\u002F parseError().code is typed as the union of all registered codes\n",[583,4694,4695,4697,4700,4702,4704],{"class":585,"line":778},[583,4696,2388],{"class":820},[583,4698,4699],{"class":608}," err ",[583,4701,2394],{"class":600},[583,4703,1863],{"class":604},[583,4705,4706],{"class":608},"(caught)\n",[583,4708,4709,4712,4715,4717,4720,4723,4725,4727,4729,4731,4734],{"class":585,"line":795},[583,4710,4711],{"class":596},"if",[583,4713,4714],{"class":608}," (err",[583,4716,636],{"class":600},[583,4718,4719],{"class":608},"code ",[583,4721,4722],{"class":600},"===",[583,4724,667],{"class":600},[583,4726,4646],{"class":615},[583,4728,612],{"class":600},[583,4730,1981],{"class":608},[583,4732,4733],{"class":604},"retry",[583,4735,2008],{"class":608},[583,4737,4738],{"class":585,"line":1227},[583,4739,4740],{"class":589},"\u002F\u002F                ↑ autocomplete, refactor-safe\n",[460,4742,4743],{},"This is purely type-level — no runtime registration, no init step. Skip it entirely if you don't need it; the runtime API is identical either way.",[4745,4746,4749,4752,4753,4756,4757,4760,4761,4764,4765,4768],"callout",{"color":4747,"icon":4748},"neutral","i-lucide-package",[1081,4750,4751],{},"Packaging tip."," A catalog is regular TypeScript. Publish ",[464,4754,4755],{},"@acme\u002Ferrors-billing"," exporting your ",[464,4758,4759],{},"defineErrorCatalog(...)"," plus the ",[464,4762,4763],{},"declare module 'evlog'"," augmentation in its ",[464,4766,4767],{},"index.d.ts",", and the typing flows transitively to every consumer that depends on it. Each shared package owns its prefix, no conflicts possible.",[4745,4770,4773,4776,4777,4780],{"color":4771,"icon":4772,"to":62},"primary","i-lucide-arrow-right",[1081,4774,4775],{},"Going further."," The dedicated ",[556,4778,4779],{"href":62},"Catalogs page"," covers the scaling story (single file → folder → feature → npm package), the full npm packaging recipe, composition patterns, the type-augmentation deep dive, and common pitfalls.",[4745,4782,4783,4784,4787],{"color":4747,"icon":83},"See the ",[556,4785,4786],{"href":217},"Next.js guide"," for a working implementation.",[562,4789,4791],{"id":4790},"next-steps","Next Steps",[477,4793,4794,4799,4804,4809],{},[480,4795,4796,4798],{},[556,4797,51],{"href":52},": Accumulate context and emit comprehensive events",[480,4800,4801,4803],{},[556,4802,353],{"href":358},": Send errors and events to Axiom, Sentry, PostHog, and more",[480,4805,4806,4808],{},[556,4807,202],{"href":207},": Auto-managed request logging per framework",[480,4810,4811,4813],{},[556,4812,20],{"href":21},": See all evlog APIs in action",[4815,4816,4817],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":579,"searchDepth":593,"depth":593,"links":4819},[4820,4821,4822,4824,4829,4831,4834,4838,4845],{"id":564,"depth":593,"text":565},{"id":949,"depth":593,"text":950},{"id":1071,"depth":593,"text":4823},"Backend-only context (internal)",{"id":1288,"depth":593,"text":1289,"children":4825},[4826,4827,4828],{"id":1293,"depth":682,"text":1294},{"id":1412,"depth":682,"text":1413},{"id":1674,"depth":682,"text":1675},{"id":1834,"depth":593,"text":4830},"Branching on code",{"id":2129,"depth":593,"text":2130,"children":4832},[4833],{"id":2632,"depth":682,"text":2633},{"id":2959,"depth":593,"text":185,"children":4835},[4836,4837],{"id":2962,"depth":682,"text":2963},{"id":3243,"depth":682,"text":3244},{"id":3403,"depth":593,"text":3404,"children":4839},[4840,4841,4842,4844],{"id":3432,"depth":682,"text":3418},{"id":4162,"depth":682,"text":4163},{"id":4334,"depth":682,"text":4843},"defineError — standalone factories",{"id":4479,"depth":682,"text":4480},{"id":4790,"depth":593,"text":4791},"Create errors that explain why they occurred and how to fix them. Add actionable context with why, fix, and link fields for humans and AI agents.","md",[4849,4851],{"label":51,"icon":54,"to":52,"color":4747,"variant":4850},"subtle",{"label":185,"icon":129,"to":186,"color":4747,"variant":4850},{},{"icon":59},{"title":56,"description":4846},"ahU08yVdRQH8_LnDkUq1tKvU0-ffxAb2I_Biu3Iy6uo",[4857,4859],{"title":51,"path":52,"stem":53,"description":4858,"icon":54,"children":-1},"Accumulate context over any unit of work and emit a single comprehensive event. Works for HTTP requests, scripts, background jobs, queue workers, and workflows.",{"title":61,"path":62,"stem":63,"description":4860,"icon":64,"children":-1},"Scale typed error and audit catalogs from a single file to multi-package monorepos. Conventions, npm packaging recipe, composition patterns, and the type-augmentation deep dive.",1778340937392]