[{"data":1,"prerenderedAt":2252},["ShallowReactive",2],{"navigation_docs":3,"-libraries-errors":612,"-libraries-errors-surround":2247},[4,35,85,138,318,453,489,548,587],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Start","\u002Fstart","1.start",[9,14,19,24,29],{"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",{"title":30,"path":31,"stem":32,"icon":33},"Choose your logger","\u002Fstart\u002Ftypescript-logging-library","1.start\u002F5.typescript-logging-library","i-lucide-file-code",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Learn","\u002Flearn","2.learn",[40,45,50,55,60,65,70,75,80],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":66,"path":67,"stem":68,"icon":69},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":71,"path":72,"stem":73,"icon":74},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":76,"path":77,"stem":78,"icon":79},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":81,"path":82,"stem":83,"icon":84},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":86,"path":87,"stem":88,"children":89,"page":34},"CLI","\u002Fcli","3.cli",[90,93,98,103,108,113,118,123,128,133],{"title":41,"path":91,"stem":92,"icon":49},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":94,"path":95,"stem":96,"icon":97},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":99,"path":100,"stem":101,"icon":102},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":104,"path":105,"stem":106,"icon":107},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":109,"path":110,"stem":111,"icon":112},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":114,"path":115,"stem":116,"icon":117},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":119,"path":120,"stem":121,"icon":122},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":124,"path":125,"stem":126,"icon":127},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":129,"path":130,"stem":131,"icon":132},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":134,"path":135,"stem":136,"icon":137},"Observability Score","\u002Fcli\u002Fobservability-score","3.cli\u002F9.observability-score","i-lucide-activity",{"title":139,"path":140,"stem":141,"children":142,"page":34},"Integrate","\u002Fintegrate","4.integrate",[143,147,230],{"title":41,"path":144,"stem":145,"icon":146},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":148,"path":149,"stem":150,"children":151,"page":34},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[152,155,185,210],{"title":41,"path":153,"stem":154,"icon":44},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":156,"path":157,"stem":158,"children":159,"page":34},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[160,165,170,175,180],{"title":161,"path":162,"stem":163,"icon":164},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":166,"path":167,"stem":168,"icon":169},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":171,"path":172,"stem":173,"icon":174},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":176,"path":177,"stem":178,"icon":179},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":181,"path":182,"stem":183,"icon":184},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":186,"path":187,"stem":188,"children":189,"page":34},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[190,195,200,205],{"title":191,"path":192,"stem":193,"icon":194},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":196,"path":197,"stem":198,"icon":199},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":201,"path":202,"stem":203,"icon":204},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":206,"path":207,"stem":208,"icon":209},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":211,"path":212,"stem":213,"children":214,"page":34},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[215,220,225],{"title":216,"path":217,"stem":218,"icon":219},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":221,"path":222,"stem":223,"icon":224},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":226,"path":227,"stem":228,"icon":229},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":231,"path":232,"stem":233,"children":234,"page":34},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[235,239,244,249,254,259,264,269,274,279,284,289,294,299,303,308,313],{"title":41,"path":236,"stem":237,"icon":238},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":240,"path":241,"stem":242,"icon":243},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":245,"path":246,"stem":247,"icon":248},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":250,"path":251,"stem":252,"icon":253},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":255,"path":256,"stem":257,"icon":258},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":260,"path":261,"stem":262,"icon":263},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":265,"path":266,"stem":267,"icon":268},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":270,"path":271,"stem":272,"icon":273},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":275,"path":276,"stem":277,"icon":278},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":280,"path":281,"stem":282,"icon":283},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":285,"path":286,"stem":287,"icon":288},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":290,"path":291,"stem":292,"icon":293},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":295,"path":296,"stem":297,"icon":298},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":300,"path":301,"stem":302,"icon":79},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":304,"path":305,"stem":306,"icon":307},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":309,"path":310,"stem":311,"icon":312},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":314,"path":315,"stem":316,"icon":317},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":319,"path":320,"stem":321,"children":322,"page":34},"Use Cases","\u002Fuse-cases","5.use-cases",[323,326,331,359,386,418,439,444,449],{"title":41,"path":324,"stem":325,"icon":107},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":327,"path":328,"stem":329,"icon":330},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":332,"icon":333,"path":334,"stem":335,"children":336,"page":34},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[337,340,345,350,355],{"title":41,"path":338,"stem":339,"icon":44},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":341,"path":342,"stem":343,"icon":344},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":346,"path":347,"stem":348,"icon":349},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":351,"path":352,"stem":353,"icon":354},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":356,"path":357,"stem":358,"icon":137},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry",{"title":360,"icon":361,"path":362,"stem":363,"children":364,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[365,368,373,378,382],{"title":41,"path":366,"stem":367,"icon":44},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":369,"path":370,"stem":371,"icon":372},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":374,"path":375,"stem":376,"icon":377},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":379,"path":380,"stem":381,"icon":330},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":383,"path":384,"stem":385,"icon":112},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":387,"icon":388,"path":389,"stem":390,"children":391,"page":34},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[392,395,400,405,410,414],{"title":41,"path":393,"stem":394,"icon":44},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":396,"path":397,"stem":398,"icon":399},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":401,"path":402,"stem":403,"icon":404},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":406,"path":407,"stem":408,"icon":409},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":411,"path":412,"stem":413,"icon":388},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":415,"path":416,"stem":417,"icon":84},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":356,"icon":112,"path":419,"stem":420,"children":421,"page":34},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[422,425,430,435],{"title":41,"path":423,"stem":424,"icon":44},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":426,"path":427,"stem":428,"icon":429},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":431,"path":432,"stem":433,"icon":434},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":436,"path":437,"stem":438,"icon":84},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":440,"path":441,"stem":442,"icon":443},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":445,"path":446,"stem":447,"icon":448},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":450,"path":451,"stem":452,"icon":434},"Node.js request logging","\u002Fuse-cases\u002Fstructured-logging-nodejs","5.use-cases\u002F6.structured-logging-nodejs",{"title":454,"path":455,"stem":456,"children":457,"page":34},"Libraries","\u002Flibraries","6.libraries",[458,462,467,470,474,479,484],{"title":41,"path":459,"stem":460,"icon":461},"\u002Flibraries\u002Foverview","6.libraries\u002F0.overview","i-lucide-package",{"title":463,"path":464,"stem":465,"icon":466},"Emitting Events","\u002Flibraries\u002Femitting","6.libraries\u002F1.emitting","i-lucide-radio",{"title":56,"path":468,"stem":469,"icon":59},"\u002Flibraries\u002Ferrors","6.libraries\u002F2.errors",{"title":471,"path":472,"stem":473,"icon":132},"Errors Agents Can Act On","\u002Flibraries\u002Fagents","6.libraries\u002F3.agents",{"title":475,"path":476,"stem":477,"icon":478},"Exporting the Catalog","\u002Flibraries\u002Fexporting","6.libraries\u002F4.exporting","i-lucide-file-output",{"title":480,"path":481,"stem":482,"icon":483},"Migrating","\u002Flibraries\u002Fmigrating","6.libraries\u002F5.migrating","i-lucide-route",{"title":485,"path":486,"stem":487,"icon":488},"Testing","\u002Flibraries\u002Ftesting","6.libraries\u002F6.testing","i-lucide-flask-conical",{"title":490,"path":491,"stem":492,"children":493,"page":34},"Extend","\u002Fextend","7.extend",[494,498,503,508,512,517,521,525,529,533,538,543],{"title":41,"path":495,"stem":496,"icon":497},"\u002Fextend\u002Foverview","7.extend\u002F0.overview","i-lucide-blocks",{"title":499,"path":500,"stem":501,"icon":502},"Stream","\u002Fextend\u002Fstream","7.extend\u002F1.stream","i-lucide-radio-tower",{"title":504,"path":505,"stem":506,"icon":507},"Custom framework","\u002Fextend\u002Fcustom-framework","7.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":509,"path":510,"stem":511,"icon":502},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","7.extend\u002F11.diagnostics-channel",{"title":513,"path":514,"stem":515,"icon":516},"FS reader","\u002Fextend\u002Ffs-reader","7.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":415,"path":518,"stem":519,"icon":520},"\u002Fextend\u002Fconsumer-recipes","7.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":522,"path":523,"stem":524,"icon":497},"Plugins","\u002Fextend\u002Fplugins","7.extend\u002F4.plugins",{"title":526,"path":527,"stem":528,"icon":443},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","7.extend\u002F5.custom-enrichers",{"title":530,"path":531,"stem":532,"icon":69},"Tail sampling","\u002Fextend\u002Ftail-sampling","7.extend\u002F6.tail-sampling",{"title":534,"path":535,"stem":536,"icon":537},"Identity headers","\u002Fextend\u002Fidentity-headers","7.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":539,"path":540,"stem":541,"icon":542},"Custom drains","\u002Fextend\u002Fcustom-drains","7.extend\u002F8.custom-drains","i-lucide-share-2",{"title":544,"path":545,"stem":546,"icon":547},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","7.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":436,"path":549,"stem":550,"children":551,"page":34},"\u002Freference","8.reference",[552,556,561,564,569,573,578,582],{"title":41,"path":553,"stem":554,"icon":555},"\u002Freference\u002Foverview","8.reference\u002F0.overview","i-lucide-book-marked",{"title":557,"path":558,"stem":559,"icon":560},"Configuration","\u002Freference\u002Fconfiguration","8.reference\u002F1.configuration","i-lucide-settings",{"title":383,"path":562,"stem":563,"icon":112},"\u002Freference\u002Fperformance","8.reference\u002F2.performance",{"title":565,"path":566,"stem":567,"icon":568},"Vite Plugin","\u002Freference\u002Fvite-plugin","8.reference\u002F3.vite-plugin","i-custom-vite",{"title":570,"path":571,"stem":572,"icon":388},"Best Practices","\u002Freference\u002Fbest-practices","8.reference\u002F4.best-practices",{"title":574,"path":575,"stem":576,"icon":577},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","8.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":579,"path":580,"stem":581,"icon":443},"Agent Skills","\u002Freference\u002Fagent-skills","8.reference\u002F6.agent-skills",{"title":583,"path":584,"stem":585,"icon":586},"Cost","\u002Freference\u002Fcost","8.reference\u002F7.cost","i-lucide-receipt",{"title":588,"path":589,"stem":590,"children":591,"page":34},"Compare","\u002Fcompare","9.compare",[592,596,600,604,608],{"title":593,"path":594,"stem":595,"icon":577},"evlog vs Pino","\u002Fcompare\u002Fpino","9.compare\u002F1.pino",{"title":597,"path":598,"stem":599,"icon":204},"evlog vs OpenTelemetry","\u002Fcompare\u002Fopentelemetry","9.compare\u002F2.opentelemetry",{"title":601,"path":602,"stem":603,"icon":577},"evlog vs LogTape","\u002Fcompare\u002Flogtape","9.compare\u002F3.logtape",{"title":605,"path":606,"stem":607,"icon":577},"evlog vs Winston: formats and request events","\u002Fcompare\u002Fwinston","9.compare\u002F4.winston",{"title":609,"path":610,"stem":611,"icon":577},"evlog vs Consola: reporters and request context","\u002Fcompare\u002Fconsola","9.compare\u002F5.consola",{"id":613,"title":56,"body":614,"description":2240,"extension":2241,"links":2242,"meta":2243,"navigation":2244,"path":468,"seo":2245,"stem":469,"__hash__":2246},"docs\u002F6.libraries\u002F2.errors.md",{"type":615,"value":616,"toc":2233},"minimark",[617,626,643,648,654,1260,1312,1329,1333,1347,1683,1689,1693,1716,2052,2067,2088,2092,2095,2197,2216,2220,2229],[618,619,620,621,625],"p",{},"The errors your package throws cross a boundary: the host catches them, serializes them, and decides what the user or the model sees. A bare ",[622,623,624],"code",{},"Error"," gives the host nothing to route on, so the response comes back as an opaque 500 and the support ticket starts with \"something failed\". A catalog replaces that with data the host can branch on, count, and display.",[618,627,628,629,638,639,642],{},"The examples here come from ",[630,631,635],"a",{"href":632,"rel":633},"https:\u002F\u002Fgithub.com\u002Fvercel-labs\u002Fgithub-tools",[634],"nofollow",[622,636,637],{},"@github-tools\u002Fsdk",", whose catalog wraps every GitHub and Vercel Connect failure the SDK can classify. The ",[630,640,641],{"href":459},"Libraries overview"," introduces the package; this page shows its catalog module, trimmed to four of its eleven entries.",[644,645,647],"h2",{"id":646},"define-a-catalog-with-a-prefix-your-package-owns","Define a catalog with a prefix your package owns",[618,649,650,653],{},[622,651,652],{},"defineErrorCatalog"," builds one factory per entry. The prefix is the first half of the wire format, so give it your package name:",[655,656,662],"pre",{"className":657,"code":658,"filename":659,"language":660,"meta":661,"style":661},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineErrorCatalog } from 'evlog'\n\nexport const githubToolsErrors = defineErrorCatalog('github_tools', {\n  TOKEN_REQUIRED: {\n    status: 401,\n    message: 'GitHub token is required. Pass it as `token` or set the GITHUB_TOKEN environment variable.',\n    why: 'No token string, async token provider, or GITHUB_TOKEN environment variable was available when the tool resolved its GitHub credentials.',\n    fix: 'Pass `token` (a PAT string or async provider) when creating the tools, set GITHUB_TOKEN, or configure a Vercel Connect `connector`.',\n    link: 'https:\u002F\u002Fgithub-tools.com\u002Fguide\u002Ftokens-and-auth',\n  },\n  RATE_LIMITED: {\n    status: 429,\n    message: ({ detail }: { detail: string }) => `GitHub rate limit exhausted: ${detail}`,\n    why: 'The token used up its GitHub API rate limit for this resource.',\n    fix: 'Stop calling this tool and retry after the reset timestamp in the message; batch reads or narrow the query to spend fewer requests.',\n    link: 'https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Frate-limits-for-the-rest-api',\n  },\n  NOT_FOUND: {\n    status: 404,\n    message: ({ detail }: { detail: string }) => `GitHub resource not found (404): ${detail}`,\n    why: 'Either the resource does not exist, or the token cannot see it. GitHub deliberately returns 404 instead of 403 for private resources the token has no access to.',\n    fix: 'Check the owner\u002Frepo\u002Fnumber input first. If it is correct, the token lacks access: grant the repository to the PAT or App installation, or use a Connect subject that has access.',\n    link: 'https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Ftroubleshooting-the-rest-api#404-not-found-for-an-existing-resource',\n  },\n  VALIDATION_FAILED: {\n    status: 422,\n    message: ({ detail }: { detail: string }) => `GitHub rejected the request as invalid (422): ${detail}`,\n    why: 'The input was well-formed but GitHub refused it: a duplicate resource, an immutable state transition, or an unresolvable ref.',\n    fix: 'The embedded GitHub message names the offending field or state; adjust the input and retry.',\n    link: 'https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Ftroubleshooting-the-rest-api#validation-failed',\n  },\n})\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    github_tools: typeof githubToolsErrors\n  }\n}\n","src\u002Fcore\u002Ferrors.ts","typescript","",[622,663,664,697,704,740,752,767,784,801,818,835,841,851,863,913,929,945,961,966,976,988,1026,1042,1058,1074,1079,1089,1101,1139,1155,1171,1187,1192,1201,1206,1223,1234,1248,1254],{"__ignoreMap":661},[665,666,669,673,677,681,684,687,690,694],"span",{"class":667,"line":668},"line",1,[665,670,672],{"class":671},"s7zQu","import",[665,674,676],{"class":675},"sMK4o"," {",[665,678,680],{"class":679},"sTEyZ"," defineErrorCatalog",[665,682,683],{"class":675}," }",[665,685,686],{"class":671}," from",[665,688,689],{"class":675}," '",[665,691,693],{"class":692},"sfazB","evlog",[665,695,696],{"class":675},"'\n",[665,698,700],{"class":667,"line":699},2,[665,701,703],{"emptyLinePlaceholder":702},true,"\n",[665,705,707,710,714,717,720,723,726,729,732,734,737],{"class":667,"line":706},3,[665,708,709],{"class":671},"export",[665,711,713],{"class":712},"spNyl"," const",[665,715,716],{"class":679}," githubToolsErrors ",[665,718,719],{"class":675},"=",[665,721,680],{"class":722},"s2Zo4",[665,724,725],{"class":679},"(",[665,727,728],{"class":675},"'",[665,730,731],{"class":692},"github_tools",[665,733,728],{"class":675},[665,735,736],{"class":675},",",[665,738,739],{"class":675}," {\n",[665,741,743,747,750],{"class":667,"line":742},4,[665,744,746],{"class":745},"swJcz","  TOKEN_REQUIRED",[665,748,749],{"class":675},":",[665,751,739],{"class":675},[665,753,755,758,760,764],{"class":667,"line":754},5,[665,756,757],{"class":745},"    status",[665,759,749],{"class":675},[665,761,763],{"class":762},"sbssI"," 401",[665,765,766],{"class":675},",\n",[665,768,770,773,775,777,780,782],{"class":667,"line":769},6,[665,771,772],{"class":745},"    message",[665,774,749],{"class":675},[665,776,689],{"class":675},[665,778,779],{"class":692},"GitHub token is required. Pass it as `token` or set the GITHUB_TOKEN environment variable.",[665,781,728],{"class":675},[665,783,766],{"class":675},[665,785,787,790,792,794,797,799],{"class":667,"line":786},7,[665,788,789],{"class":745},"    why",[665,791,749],{"class":675},[665,793,689],{"class":675},[665,795,796],{"class":692},"No token string, async token provider, or GITHUB_TOKEN environment variable was available when the tool resolved its GitHub credentials.",[665,798,728],{"class":675},[665,800,766],{"class":675},[665,802,804,807,809,811,814,816],{"class":667,"line":803},8,[665,805,806],{"class":745},"    fix",[665,808,749],{"class":675},[665,810,689],{"class":675},[665,812,813],{"class":692},"Pass `token` (a PAT string or async provider) when creating the tools, set GITHUB_TOKEN, or configure a Vercel Connect `connector`.",[665,815,728],{"class":675},[665,817,766],{"class":675},[665,819,821,824,826,828,831,833],{"class":667,"line":820},9,[665,822,823],{"class":745},"    link",[665,825,749],{"class":675},[665,827,689],{"class":675},[665,829,830],{"class":692},"https:\u002F\u002Fgithub-tools.com\u002Fguide\u002Ftokens-and-auth",[665,832,728],{"class":675},[665,834,766],{"class":675},[665,836,838],{"class":667,"line":837},10,[665,839,840],{"class":675},"  },\n",[665,842,844,847,849],{"class":667,"line":843},11,[665,845,846],{"class":745},"  RATE_LIMITED",[665,848,749],{"class":675},[665,850,739],{"class":675},[665,852,854,856,858,861],{"class":667,"line":853},12,[665,855,757],{"class":745},[665,857,749],{"class":675},[665,859,860],{"class":762}," 429",[665,862,766],{"class":675},[665,864,866,868,870,873,877,880,882,884,886,890,893,896,899,902,905,908,911],{"class":667,"line":865},13,[665,867,772],{"class":722},[665,869,749],{"class":675},[665,871,872],{"class":675}," ({",[665,874,876],{"class":875},"sHdIc"," detail",[665,878,879],{"class":675}," }:",[665,881,676],{"class":675},[665,883,876],{"class":745},[665,885,749],{"class":675},[665,887,889],{"class":888},"sBMFI"," string",[665,891,892],{"class":675}," })",[665,894,895],{"class":712}," =>",[665,897,898],{"class":675}," `",[665,900,901],{"class":692},"GitHub rate limit exhausted: ",[665,903,904],{"class":675},"${",[665,906,907],{"class":679},"detail",[665,909,910],{"class":675},"}`",[665,912,766],{"class":675},[665,914,916,918,920,922,925,927],{"class":667,"line":915},14,[665,917,789],{"class":745},[665,919,749],{"class":675},[665,921,689],{"class":675},[665,923,924],{"class":692},"The token used up its GitHub API rate limit for this resource.",[665,926,728],{"class":675},[665,928,766],{"class":675},[665,930,932,934,936,938,941,943],{"class":667,"line":931},15,[665,933,806],{"class":745},[665,935,749],{"class":675},[665,937,689],{"class":675},[665,939,940],{"class":692},"Stop calling this tool and retry after the reset timestamp in the message; batch reads or narrow the query to spend fewer requests.",[665,942,728],{"class":675},[665,944,766],{"class":675},[665,946,948,950,952,954,957,959],{"class":667,"line":947},16,[665,949,823],{"class":745},[665,951,749],{"class":675},[665,953,689],{"class":675},[665,955,956],{"class":692},"https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Frate-limits-for-the-rest-api",[665,958,728],{"class":675},[665,960,766],{"class":675},[665,962,964],{"class":667,"line":963},17,[665,965,840],{"class":675},[665,967,969,972,974],{"class":667,"line":968},18,[665,970,971],{"class":745},"  NOT_FOUND",[665,973,749],{"class":675},[665,975,739],{"class":675},[665,977,979,981,983,986],{"class":667,"line":978},19,[665,980,757],{"class":745},[665,982,749],{"class":675},[665,984,985],{"class":762}," 404",[665,987,766],{"class":675},[665,989,991,993,995,997,999,1001,1003,1005,1007,1009,1011,1013,1015,1018,1020,1022,1024],{"class":667,"line":990},20,[665,992,772],{"class":722},[665,994,749],{"class":675},[665,996,872],{"class":675},[665,998,876],{"class":875},[665,1000,879],{"class":675},[665,1002,676],{"class":675},[665,1004,876],{"class":745},[665,1006,749],{"class":675},[665,1008,889],{"class":888},[665,1010,892],{"class":675},[665,1012,895],{"class":712},[665,1014,898],{"class":675},[665,1016,1017],{"class":692},"GitHub resource not found (404): ",[665,1019,904],{"class":675},[665,1021,907],{"class":679},[665,1023,910],{"class":675},[665,1025,766],{"class":675},[665,1027,1029,1031,1033,1035,1038,1040],{"class":667,"line":1028},21,[665,1030,789],{"class":745},[665,1032,749],{"class":675},[665,1034,689],{"class":675},[665,1036,1037],{"class":692},"Either the resource does not exist, or the token cannot see it. GitHub deliberately returns 404 instead of 403 for private resources the token has no access to.",[665,1039,728],{"class":675},[665,1041,766],{"class":675},[665,1043,1045,1047,1049,1051,1054,1056],{"class":667,"line":1044},22,[665,1046,806],{"class":745},[665,1048,749],{"class":675},[665,1050,689],{"class":675},[665,1052,1053],{"class":692},"Check the owner\u002Frepo\u002Fnumber input first. If it is correct, the token lacks access: grant the repository to the PAT or App installation, or use a Connect subject that has access.",[665,1055,728],{"class":675},[665,1057,766],{"class":675},[665,1059,1061,1063,1065,1067,1070,1072],{"class":667,"line":1060},23,[665,1062,823],{"class":745},[665,1064,749],{"class":675},[665,1066,689],{"class":675},[665,1068,1069],{"class":692},"https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Ftroubleshooting-the-rest-api#404-not-found-for-an-existing-resource",[665,1071,728],{"class":675},[665,1073,766],{"class":675},[665,1075,1077],{"class":667,"line":1076},24,[665,1078,840],{"class":675},[665,1080,1082,1085,1087],{"class":667,"line":1081},25,[665,1083,1084],{"class":745},"  VALIDATION_FAILED",[665,1086,749],{"class":675},[665,1088,739],{"class":675},[665,1090,1092,1094,1096,1099],{"class":667,"line":1091},26,[665,1093,757],{"class":745},[665,1095,749],{"class":675},[665,1097,1098],{"class":762}," 422",[665,1100,766],{"class":675},[665,1102,1104,1106,1108,1110,1112,1114,1116,1118,1120,1122,1124,1126,1128,1131,1133,1135,1137],{"class":667,"line":1103},27,[665,1105,772],{"class":722},[665,1107,749],{"class":675},[665,1109,872],{"class":675},[665,1111,876],{"class":875},[665,1113,879],{"class":675},[665,1115,676],{"class":675},[665,1117,876],{"class":745},[665,1119,749],{"class":675},[665,1121,889],{"class":888},[665,1123,892],{"class":675},[665,1125,895],{"class":712},[665,1127,898],{"class":675},[665,1129,1130],{"class":692},"GitHub rejected the request as invalid (422): ",[665,1132,904],{"class":675},[665,1134,907],{"class":679},[665,1136,910],{"class":675},[665,1138,766],{"class":675},[665,1140,1142,1144,1146,1148,1151,1153],{"class":667,"line":1141},28,[665,1143,789],{"class":745},[665,1145,749],{"class":675},[665,1147,689],{"class":675},[665,1149,1150],{"class":692},"The input was well-formed but GitHub refused it: a duplicate resource, an immutable state transition, or an unresolvable ref.",[665,1152,728],{"class":675},[665,1154,766],{"class":675},[665,1156,1158,1160,1162,1164,1167,1169],{"class":667,"line":1157},29,[665,1159,806],{"class":745},[665,1161,749],{"class":675},[665,1163,689],{"class":675},[665,1165,1166],{"class":692},"The embedded GitHub message names the offending field or state; adjust the input and retry.",[665,1168,728],{"class":675},[665,1170,766],{"class":675},[665,1172,1174,1176,1178,1180,1183,1185],{"class":667,"line":1173},30,[665,1175,823],{"class":745},[665,1177,749],{"class":675},[665,1179,689],{"class":675},[665,1181,1182],{"class":692},"https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Ftroubleshooting-the-rest-api#validation-failed",[665,1184,728],{"class":675},[665,1186,766],{"class":675},[665,1188,1190],{"class":667,"line":1189},31,[665,1191,840],{"class":675},[665,1193,1195,1198],{"class":667,"line":1194},32,[665,1196,1197],{"class":675},"}",[665,1199,1200],{"class":679},")\n",[665,1202,1204],{"class":667,"line":1203},33,[665,1205,703],{"emptyLinePlaceholder":702},[665,1207,1209,1212,1215,1217,1219,1221],{"class":667,"line":1208},34,[665,1210,1211],{"class":712},"declare",[665,1213,1214],{"class":712}," module",[665,1216,689],{"class":675},[665,1218,693],{"class":692},[665,1220,728],{"class":675},[665,1222,739],{"class":675},[665,1224,1226,1229,1232],{"class":667,"line":1225},35,[665,1227,1228],{"class":712},"  interface",[665,1230,1231],{"class":888}," RegisteredErrorCatalogs",[665,1233,739],{"class":675},[665,1235,1237,1240,1242,1245],{"class":667,"line":1236},36,[665,1238,1239],{"class":745},"    github_tools",[665,1241,749],{"class":675},[665,1243,1244],{"class":675}," typeof",[665,1246,1247],{"class":679}," githubToolsErrors\n",[665,1249,1251],{"class":667,"line":1250},37,[665,1252,1253],{"class":675},"  }\n",[665,1255,1257],{"class":667,"line":1256},38,[665,1258,1259],{"class":675},"}\n",[618,1261,1262,1263,1266,1267,1270,1271,1274,1275,1274,1278,1274,1281,1284,1285,1288,1289,1292,1293,1296,1297,1299,1300,1302,1303,1305,1306,1308,1309,1311],{},"Each entry accepts ",[622,1264,1265],{},"status"," (default 500), ",[622,1268,1269],{},"message"," as a constant string or a typed function whose params become required factory arguments, ",[622,1272,1273],{},"why",", ",[622,1276,1277],{},"fix",[622,1279,1280],{},"link",[622,1282,1283],{},"tags",", and ",[622,1286,1287],{},"internal"," for backend-only context. The ",[622,1290,1291],{},"declare module"," block gives consumers autocomplete on ",[622,1294,1295],{},"github_tools.NOT_FOUND"," wherever they match on ",[622,1298,622],{},". ",[630,1301,56],{"href":57}," documents the full anatomy as an application sees it; ",[630,1304,471],{"href":472}," covers what goes into ",[622,1307,1273],{}," and ",[622,1310,1277],{},".",[618,1313,1314,1315,1318,1319,1322,1323,1325,1326,1328],{},"The wire format is ",[622,1316,1317],{},"${prefix}.${KEY}",": throw ",[622,1320,1321],{},"githubToolsErrors.NOT_FOUND({ detail })"," and the host receives an error whose ",[622,1324,622],{}," is ",[622,1327,1295],{},". One prefix per package keeps a graph coherent: a host running several evlog-instrumented packages never sees two codes collide, because each package owns one namespace the way it owns one npm name.",[644,1330,1332],{"id":1331},"wrap-upstream-failures-instead-of-rethrowing-them","Wrap upstream failures instead of rethrowing them",[618,1334,1335,1336,1339,1340,1343,1344,1346],{},"Most library errors start as someone else's error: an Octokit ",[622,1337,1338],{},"RequestError",", a fetch failure, a provider SDK exception. Map them to catalog entries at the boundary where you know the cause, keep the original as ",[622,1341,1342],{},"cause",", and put request coordinates in ",[622,1345,1287],{}," so they reach the host's logs and never the client:",[655,1348,1350],{"className":657,"code":1349,"filename":659,"language":660,"meta":661,"style":661},"export function toGithubToolsError(error: unknown): unknown {\n  const status = errorStatus(error)\n  if (status === undefined || !(error instanceof Error)) return error\n\n  const detail = error.message\n  const overrides = { cause: error, internal: { status, ...requestTarget(error) } }\n\n  if (status === 401) return githubToolsErrors.UNAUTHORIZED({ detail, ...overrides })\n  if (status === 404) return githubToolsErrors.NOT_FOUND({ detail, ...overrides })\n  if (status === 422) return githubToolsErrors.VALIDATION_FAILED({ detail, ...overrides })\n  if (status === 429) return githubToolsErrors.RATE_LIMITED({ detail, ...overrides })\n  return error\n}\n",[622,1351,1352,1379,1399,1440,1444,1460,1509,1513,1555,1594,1633,1672,1679],{"__ignoreMap":661},[665,1353,1354,1356,1359,1362,1364,1367,1369,1372,1375,1377],{"class":667,"line":668},[665,1355,709],{"class":671},[665,1357,1358],{"class":712}," function",[665,1360,1361],{"class":722}," toGithubToolsError",[665,1363,725],{"class":675},[665,1365,1366],{"class":875},"error",[665,1368,749],{"class":675},[665,1370,1371],{"class":888}," unknown",[665,1373,1374],{"class":675},"):",[665,1376,1371],{"class":888},[665,1378,739],{"class":675},[665,1380,1381,1384,1387,1390,1393,1395,1397],{"class":667,"line":699},[665,1382,1383],{"class":712},"  const",[665,1385,1386],{"class":679}," status",[665,1388,1389],{"class":675}," =",[665,1391,1392],{"class":722}," errorStatus",[665,1394,725],{"class":745},[665,1396,1366],{"class":679},[665,1398,1200],{"class":745},[665,1400,1401,1404,1407,1409,1412,1415,1418,1421,1423,1425,1428,1431,1434,1437],{"class":667,"line":706},[665,1402,1403],{"class":671},"  if",[665,1405,1406],{"class":745}," (",[665,1408,1265],{"class":679},[665,1410,1411],{"class":675}," ===",[665,1413,1414],{"class":675}," undefined",[665,1416,1417],{"class":675}," ||",[665,1419,1420],{"class":675}," !",[665,1422,725],{"class":745},[665,1424,1366],{"class":679},[665,1426,1427],{"class":675}," instanceof",[665,1429,1430],{"class":888}," Error",[665,1432,1433],{"class":745},")) ",[665,1435,1436],{"class":671},"return",[665,1438,1439],{"class":679}," error\n",[665,1441,1442],{"class":667,"line":742},[665,1443,703],{"emptyLinePlaceholder":702},[665,1445,1446,1448,1450,1452,1455,1457],{"class":667,"line":754},[665,1447,1383],{"class":712},[665,1449,876],{"class":679},[665,1451,1389],{"class":675},[665,1453,1454],{"class":679}," error",[665,1456,1311],{"class":675},[665,1458,1459],{"class":679},"message\n",[665,1461,1462,1464,1467,1469,1471,1474,1476,1478,1480,1483,1485,1487,1489,1491,1494,1497,1499,1501,1504,1506],{"class":667,"line":769},[665,1463,1383],{"class":712},[665,1465,1466],{"class":679}," overrides",[665,1468,1389],{"class":675},[665,1470,676],{"class":675},[665,1472,1473],{"class":745}," cause",[665,1475,749],{"class":675},[665,1477,1454],{"class":679},[665,1479,736],{"class":675},[665,1481,1482],{"class":745}," internal",[665,1484,749],{"class":675},[665,1486,676],{"class":675},[665,1488,1386],{"class":679},[665,1490,736],{"class":675},[665,1492,1493],{"class":675}," ...",[665,1495,1496],{"class":722},"requestTarget",[665,1498,725],{"class":745},[665,1500,1366],{"class":679},[665,1502,1503],{"class":745},") ",[665,1505,1197],{"class":675},[665,1507,1508],{"class":675}," }\n",[665,1510,1511],{"class":667,"line":786},[665,1512,703],{"emptyLinePlaceholder":702},[665,1514,1515,1517,1519,1521,1523,1525,1527,1529,1532,1534,1537,1539,1542,1544,1546,1548,1551,1553],{"class":667,"line":803},[665,1516,1403],{"class":671},[665,1518,1406],{"class":745},[665,1520,1265],{"class":679},[665,1522,1411],{"class":675},[665,1524,763],{"class":762},[665,1526,1503],{"class":745},[665,1528,1436],{"class":671},[665,1530,1531],{"class":679}," githubToolsErrors",[665,1533,1311],{"class":675},[665,1535,1536],{"class":722},"UNAUTHORIZED",[665,1538,725],{"class":745},[665,1540,1541],{"class":675},"{",[665,1543,876],{"class":679},[665,1545,736],{"class":675},[665,1547,1493],{"class":675},[665,1549,1550],{"class":679},"overrides",[665,1552,683],{"class":675},[665,1554,1200],{"class":745},[665,1556,1557,1559,1561,1563,1565,1567,1569,1571,1573,1575,1578,1580,1582,1584,1586,1588,1590,1592],{"class":667,"line":820},[665,1558,1403],{"class":671},[665,1560,1406],{"class":745},[665,1562,1265],{"class":679},[665,1564,1411],{"class":675},[665,1566,985],{"class":762},[665,1568,1503],{"class":745},[665,1570,1436],{"class":671},[665,1572,1531],{"class":679},[665,1574,1311],{"class":675},[665,1576,1577],{"class":722},"NOT_FOUND",[665,1579,725],{"class":745},[665,1581,1541],{"class":675},[665,1583,876],{"class":679},[665,1585,736],{"class":675},[665,1587,1493],{"class":675},[665,1589,1550],{"class":679},[665,1591,683],{"class":675},[665,1593,1200],{"class":745},[665,1595,1596,1598,1600,1602,1604,1606,1608,1610,1612,1614,1617,1619,1621,1623,1625,1627,1629,1631],{"class":667,"line":837},[665,1597,1403],{"class":671},[665,1599,1406],{"class":745},[665,1601,1265],{"class":679},[665,1603,1411],{"class":675},[665,1605,1098],{"class":762},[665,1607,1503],{"class":745},[665,1609,1436],{"class":671},[665,1611,1531],{"class":679},[665,1613,1311],{"class":675},[665,1615,1616],{"class":722},"VALIDATION_FAILED",[665,1618,725],{"class":745},[665,1620,1541],{"class":675},[665,1622,876],{"class":679},[665,1624,736],{"class":675},[665,1626,1493],{"class":675},[665,1628,1550],{"class":679},[665,1630,683],{"class":675},[665,1632,1200],{"class":745},[665,1634,1635,1637,1639,1641,1643,1645,1647,1649,1651,1653,1656,1658,1660,1662,1664,1666,1668,1670],{"class":667,"line":843},[665,1636,1403],{"class":671},[665,1638,1406],{"class":745},[665,1640,1265],{"class":679},[665,1642,1411],{"class":675},[665,1644,860],{"class":762},[665,1646,1503],{"class":745},[665,1648,1436],{"class":671},[665,1650,1531],{"class":679},[665,1652,1311],{"class":675},[665,1654,1655],{"class":722},"RATE_LIMITED",[665,1657,725],{"class":745},[665,1659,1541],{"class":675},[665,1661,876],{"class":679},[665,1663,736],{"class":675},[665,1665,1493],{"class":675},[665,1667,1550],{"class":679},[665,1669,683],{"class":675},[665,1671,1200],{"class":745},[665,1673,1674,1677],{"class":667,"line":853},[665,1675,1676],{"class":671},"  return",[665,1678,1439],{"class":679},[665,1680,1681],{"class":667,"line":865},[665,1682,1259],{"class":675},[618,1684,1685,1686,1688],{},"Statuses without an entry pass through unchanged. That is deliberate: a catalog error with a vague ",[622,1687,1273],{}," is worse than the original, because the consumer trusts it. Add an entry when you can name the cause and the fix, and let the rest through until you can.",[644,1690,1692],{"id":1691},"what-the-host-receives","What the host receives",[618,1694,1695,1696,1699,1700,1274,1702,1274,1704,1274,1706,1274,1708,1284,1710,1712,1713,749],{},"Throwing the factory's result is the whole integration. The ",[622,1697,1698],{},"EvlogError"," carries ",[622,1701,622],{},[622,1703,1265],{},[622,1705,1269],{},[622,1707,1273],{},[622,1709,1277],{},[622,1711,1280],{}," as own properties, and serializes with the guidance nested under ",[622,1714,1715],{},"data",[1717,1718,1719,1764,1969],"code-group",{},[655,1720,1723],{"className":657,"code":1721,"filename":1722,"language":660,"meta":661,"style":661},"throw githubToolsErrors.NOT_FOUND({ detail: 'Not Found', cause: octokitError })\n","src\u002Ftools\u002Fget-issue.ts",[622,1724,1725],{"__ignoreMap":661},[665,1726,1727,1730,1732,1734,1736,1738,1740,1742,1744,1746,1749,1751,1753,1755,1757,1760,1762],{"class":667,"line":668},[665,1728,1729],{"class":671},"throw",[665,1731,1531],{"class":679},[665,1733,1311],{"class":675},[665,1735,1577],{"class":722},[665,1737,725],{"class":679},[665,1739,1541],{"class":675},[665,1741,876],{"class":745},[665,1743,749],{"class":675},[665,1745,689],{"class":675},[665,1747,1748],{"class":692},"Not Found",[665,1750,728],{"class":675},[665,1752,736],{"class":675},[665,1754,1473],{"class":745},[665,1756,749],{"class":675},[665,1758,1759],{"class":679}," octokitError ",[665,1761,1197],{"class":675},[665,1763,1200],{"class":679},[655,1765,1770],{"className":1766,"code":1767,"filename":1768,"language":1769,"meta":661,"style":661},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"name\": \"EvlogError\",\n  \"message\": \"GitHub resource not found (404): Not Found\",\n  \"status\": 404,\n  \"data\": {\n    \"code\": \"github_tools.NOT_FOUND\",\n    \"why\": \"Either the resource does not exist, or the token cannot see it. GitHub deliberately returns 404 instead of 403 for private resources the token has no access to.\",\n    \"fix\": \"Check the owner\u002Frepo\u002Fnumber input first. If it is correct, the token lacks access: grant the repository to the PAT or App installation, or use a Connect subject that has access.\",\n    \"link\": \"https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fusing-the-rest-api\u002Ftroubleshooting-the-rest-api#404-not-found-for-an-existing-resource\"\n  },\n  \"cause\": { \"name\": \"HttpError\", \"message\": \"Not Found\" }\n}\n","JSON.stringify(error)","json",[622,1771,1772,1777,1799,1818,1832,1844,1863,1881,1899,1916,1920,1965],{"__ignoreMap":661},[665,1773,1774],{"class":667,"line":668},[665,1775,1776],{"class":675},"{\n",[665,1778,1779,1782,1785,1788,1790,1793,1795,1797],{"class":667,"line":699},[665,1780,1781],{"class":675},"  \"",[665,1783,1784],{"class":712},"name",[665,1786,1787],{"class":675},"\"",[665,1789,749],{"class":675},[665,1791,1792],{"class":675}," \"",[665,1794,1698],{"class":692},[665,1796,1787],{"class":675},[665,1798,766],{"class":675},[665,1800,1801,1803,1805,1807,1809,1811,1814,1816],{"class":667,"line":706},[665,1802,1781],{"class":675},[665,1804,1269],{"class":712},[665,1806,1787],{"class":675},[665,1808,749],{"class":675},[665,1810,1792],{"class":675},[665,1812,1813],{"class":692},"GitHub resource not found (404): Not Found",[665,1815,1787],{"class":675},[665,1817,766],{"class":675},[665,1819,1820,1822,1824,1826,1828,1830],{"class":667,"line":742},[665,1821,1781],{"class":675},[665,1823,1265],{"class":712},[665,1825,1787],{"class":675},[665,1827,749],{"class":675},[665,1829,985],{"class":762},[665,1831,766],{"class":675},[665,1833,1834,1836,1838,1840,1842],{"class":667,"line":754},[665,1835,1781],{"class":675},[665,1837,1715],{"class":712},[665,1839,1787],{"class":675},[665,1841,749],{"class":675},[665,1843,739],{"class":675},[665,1845,1846,1849,1851,1853,1855,1857,1859,1861],{"class":667,"line":769},[665,1847,1848],{"class":675},"    \"",[665,1850,622],{"class":888},[665,1852,1787],{"class":675},[665,1854,749],{"class":675},[665,1856,1792],{"class":675},[665,1858,1295],{"class":692},[665,1860,1787],{"class":675},[665,1862,766],{"class":675},[665,1864,1865,1867,1869,1871,1873,1875,1877,1879],{"class":667,"line":786},[665,1866,1848],{"class":675},[665,1868,1273],{"class":888},[665,1870,1787],{"class":675},[665,1872,749],{"class":675},[665,1874,1792],{"class":675},[665,1876,1037],{"class":692},[665,1878,1787],{"class":675},[665,1880,766],{"class":675},[665,1882,1883,1885,1887,1889,1891,1893,1895,1897],{"class":667,"line":803},[665,1884,1848],{"class":675},[665,1886,1277],{"class":888},[665,1888,1787],{"class":675},[665,1890,749],{"class":675},[665,1892,1792],{"class":675},[665,1894,1053],{"class":692},[665,1896,1787],{"class":675},[665,1898,766],{"class":675},[665,1900,1901,1903,1905,1907,1909,1911,1913],{"class":667,"line":820},[665,1902,1848],{"class":675},[665,1904,1280],{"class":888},[665,1906,1787],{"class":675},[665,1908,749],{"class":675},[665,1910,1792],{"class":675},[665,1912,1069],{"class":692},[665,1914,1915],{"class":675},"\"\n",[665,1917,1918],{"class":667,"line":837},[665,1919,840],{"class":675},[665,1921,1922,1924,1926,1928,1930,1932,1934,1936,1938,1940,1942,1945,1947,1949,1951,1953,1955,1957,1959,1961,1963],{"class":667,"line":843},[665,1923,1781],{"class":675},[665,1925,1342],{"class":712},[665,1927,1787],{"class":675},[665,1929,749],{"class":675},[665,1931,676],{"class":675},[665,1933,1792],{"class":675},[665,1935,1784],{"class":888},[665,1937,1787],{"class":675},[665,1939,749],{"class":675},[665,1941,1792],{"class":675},[665,1943,1944],{"class":692},"HttpError",[665,1946,1787],{"class":675},[665,1948,736],{"class":675},[665,1950,1792],{"class":675},[665,1952,1269],{"class":888},[665,1954,1787],{"class":675},[665,1956,749],{"class":675},[665,1958,1792],{"class":675},[665,1960,1748],{"class":692},[665,1962,1787],{"class":675},[665,1964,1508],{"class":675},[665,1966,1967],{"class":667,"line":853},[665,1968,1259],{"class":675},[655,1970,1973],{"className":657,"code":1971,"filename":1972,"language":660,"meta":661,"style":661},"import { parseError } from 'evlog'\n\nconst { code, status, why, fix, link } = parseError(error)\n\u002F\u002F code   → 'github_tools.NOT_FOUND'\n\u002F\u002F status → 404\n\u002F\u002F why, fix, link → the strings above\n","parseError(error)",[622,1974,1975,1994,1998,2036,2042,2047],{"__ignoreMap":661},[665,1976,1977,1979,1981,1984,1986,1988,1990,1992],{"class":667,"line":668},[665,1978,672],{"class":671},[665,1980,676],{"class":675},[665,1982,1983],{"class":679}," parseError",[665,1985,683],{"class":675},[665,1987,686],{"class":671},[665,1989,689],{"class":675},[665,1991,693],{"class":692},[665,1993,696],{"class":675},[665,1995,1996],{"class":667,"line":699},[665,1997,703],{"emptyLinePlaceholder":702},[665,1999,2000,2003,2005,2008,2010,2012,2014,2017,2019,2022,2024,2027,2029,2031,2033],{"class":667,"line":706},[665,2001,2002],{"class":712},"const",[665,2004,676],{"class":675},[665,2006,2007],{"class":679}," code",[665,2009,736],{"class":675},[665,2011,1386],{"class":679},[665,2013,736],{"class":675},[665,2015,2016],{"class":679}," why",[665,2018,736],{"class":675},[665,2020,2021],{"class":679}," fix",[665,2023,736],{"class":675},[665,2025,2026],{"class":679}," link ",[665,2028,1197],{"class":675},[665,2030,1389],{"class":675},[665,2032,1983],{"class":722},[665,2034,2035],{"class":679},"(error)\n",[665,2037,2038],{"class":667,"line":742},[665,2039,2041],{"class":2040},"sHwdD","\u002F\u002F code   → 'github_tools.NOT_FOUND'\n",[665,2043,2044],{"class":667,"line":754},[665,2045,2046],{"class":2040},"\u002F\u002F status → 404\n",[665,2048,2049],{"class":667,"line":769},[665,2050,2051],{"class":2040},"\u002F\u002F why, fix, link → the strings above\n",[618,2053,2054,2056,2057,2060,2061,2063,2064,2066],{},[622,2055,1287],{}," is absent from both. It is omitted from ",[622,2058,2059],{},"toJSON()"," and from every framework serializer, so it is the right place for the request URL, the raw status, or anything else you would not send to a client. The framework integrations put ",[622,2062,1265],{}," on the HTTP response and index ",[622,2065,622],{}," in the drained event without any code on the host's side.",[618,2068,2069,2070,2073,2074,2077,2078,2080,2081,2084,2085,2087],{},"Hosts should catch with ",[622,2071,2072],{},"EvlogError.isEvlogError(error)"," rather than ",[622,2075,2076],{},"instanceof",". Package managers routinely install more than one physical copy of evlog, and ",[622,2079,2076],{}," silently reports ",[622,2082,2083],{},"false"," across copies, which downgrades your structured error to a bare 500. The brand check works across copies. Put that sentence in your package's error guide; ",[630,2086,475],{"href":476}," generates the rest of that guide from the catalog itself.",[644,2089,2091],{"id":2090},"publish-the-catalog-as-its-own-entrypoint","Publish the catalog as its own entrypoint",[618,2093,2094],{},"Put the catalog in its own module and export it under a subpath, so hosts can import your codes without pulling the rest of the package:",[655,2096,2099],{"className":1766,"code":2097,"filename":2098,"language":1769,"meta":661,"style":661},"{\n  \"exports\": {\n    \".\": \".\u002Fdist\u002Findex.mjs\",\n    \".\u002Ferrors\": \".\u002Fdist\u002Ferrors.mjs\"\n  },\n  \"peerDependencies\": {\n    \"evlog\": \"^2.0.0\"\n  }\n}\n","package.json",[622,2100,2101,2105,2118,2137,2155,2159,2172,2189,2193],{"__ignoreMap":661},[665,2102,2103],{"class":667,"line":668},[665,2104,1776],{"class":675},[665,2106,2107,2109,2112,2114,2116],{"class":667,"line":699},[665,2108,1781],{"class":675},[665,2110,2111],{"class":712},"exports",[665,2113,1787],{"class":675},[665,2115,749],{"class":675},[665,2117,739],{"class":675},[665,2119,2120,2122,2124,2126,2128,2130,2133,2135],{"class":667,"line":706},[665,2121,1848],{"class":675},[665,2123,1311],{"class":888},[665,2125,1787],{"class":675},[665,2127,749],{"class":675},[665,2129,1792],{"class":675},[665,2131,2132],{"class":692},".\u002Fdist\u002Findex.mjs",[665,2134,1787],{"class":675},[665,2136,766],{"class":675},[665,2138,2139,2141,2144,2146,2148,2150,2153],{"class":667,"line":742},[665,2140,1848],{"class":675},[665,2142,2143],{"class":888},".\u002Ferrors",[665,2145,1787],{"class":675},[665,2147,749],{"class":675},[665,2149,1792],{"class":675},[665,2151,2152],{"class":692},".\u002Fdist\u002Ferrors.mjs",[665,2154,1915],{"class":675},[665,2156,2157],{"class":667,"line":754},[665,2158,840],{"class":675},[665,2160,2161,2163,2166,2168,2170],{"class":667,"line":769},[665,2162,1781],{"class":675},[665,2164,2165],{"class":712},"peerDependencies",[665,2167,1787],{"class":675},[665,2169,749],{"class":675},[665,2171,739],{"class":675},[665,2173,2174,2176,2178,2180,2182,2184,2187],{"class":667,"line":786},[665,2175,1848],{"class":675},[665,2177,693],{"class":888},[665,2179,1787],{"class":675},[665,2181,749],{"class":675},[665,2183,1792],{"class":675},[665,2185,2186],{"class":692},"^2.0.0",[665,2188,1915],{"class":675},[665,2190,2191],{"class":667,"line":803},[665,2192,1253],{"class":675},[665,2194,2195],{"class":667,"line":820},[665,2196,1259],{"class":675},[618,2198,2199,2201,2202,2204,2205,2208,2209,2212,2213,2215],{},[622,2200,693],{}," stays a peer dependency: the factories build ",[622,2203,1698],{}," instances from whatever copy of evlog the host resolved, so your errors and the host's share one type. A host that wants to branch on your failures imports ",[622,2206,2207],{},"githubToolsErrors"," and compares ",[622,2210,2211],{},"error.code === githubToolsErrors.NOT_FOUND.code",", which survives a refactor on your side the way a string literal does not. If your package is large enough to need several catalogs, the npm packaging recipe on ",[630,2214,81],{"href":82}," covers splitting them per bounded context.",[644,2217,2219],{"id":2218},"treat-error-codes-as-wire-format","Treat error codes as wire format",[618,2221,2222,2223,2225,2226,2228],{},"The code string crosses your package boundary and lands in the host's dashboards, alerts, support macros, and the prompts of agents that learned to match on it. Renaming a code is a breaking change, the same way renaming an exported function is. Add codes freely, reorder entries safely, and when a code must go, keep the old entry with a ",[622,2224,1273],{}," that names its replacement for one major before you delete it. ",[630,2227,485],{"href":486}," shows how to make a rename fail in your own suite before it fails in a host.",[2230,2231,2232],"style",{},"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 .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 pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .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}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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}",{"title":661,"searchDepth":699,"depth":699,"links":2234},[2235,2236,2237,2238,2239],{"id":646,"depth":699,"text":647},{"id":1331,"depth":699,"text":1332},{"id":1691,"depth":699,"text":1692},{"id":2090,"depth":699,"text":2091},{"id":2218,"depth":699,"text":2219},"Replace bare errors with a catalog your package owns: what the host receives, how upstream failures map into it, and why codes are wire format.","md",null,{},{"title":56,"icon":59},{"title":56,"description":2240},"SGerGM__VZavTa8nP0dPDKo0BRtjnd2ggpiy8WchHpU",[2248,2250],{"title":463,"path":464,"stem":465,"description":2249,"icon":466,"children":-1},"Emit events from library code the host can attribute and filter: join the host's request, tag your own events, and stay out of the configuration.",{"title":471,"path":472,"stem":473,"description":2251,"icon":132,"children":-1},"Write why, fix, and link so a model calling your package recovers from the error itself, without a docs round-trip and the tokens it costs.",1789294039443]