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