[{"data":1,"prerenderedAt":2558},["ShallowReactive",2],{"navigation_docs_en":3,"-en-errs-api":448,"-en-errs-api-surround":2553},[4,45,120,157,173,203,233,259,271,287,307,326,339,356,373,386,398,425],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":44},"Getting Started","i-lucide-rocket","\u002Fen\u002Fgetting-started","en\u002F01.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fen\u002Fgetting-started\u002Fintroduction","en\u002F01.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F01.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Your first module","\u002Fen\u002Fgetting-started\u002Ffirst-module","en\u002F01.getting-started\u002F3.first-module","i-lucide-package-plus",{"title":26,"path":27,"stem":28,"icon":29},"Project structure","\u002Fen\u002Fgetting-started\u002Fproject-structure","en\u002F01.getting-started\u002F4.project-structure","i-lucide-folder-tree",{"title":31,"path":32,"stem":33,"icon":34},"The shop sample application","\u002Fen\u002Fgetting-started\u002Fsample-app","en\u002F01.getting-started\u002F5.sample-app","i-lucide-shopping-cart",{"title":36,"path":37,"stem":38,"icon":39},"Coming from Laravel","\u002Fen\u002Fgetting-started\u002Fcoming-from-laravel","en\u002F01.getting-started\u002F6.coming-from-laravel","i-lucide-arrow-right-left",{"title":41,"path":42,"stem":43,"icon":39},"Coming from Symfony","\u002Fen\u002Fgetting-started\u002Fcoming-from-symfony","en\u002F01.getting-started\u002F7.coming-from-symfony",false,{"title":46,"icon":47,"path":48,"stem":49,"children":50,"page":44},"CLI Reference","i-lucide-terminal","\u002Fen\u002Fcli","en\u002F02.cli",[51,55,60,65,70,75,80,85,90,95,100,105,110,115],{"title":52,"path":53,"stem":54,"icon":47},"Overview","\u002Fen\u002Fcli\u002Foverview","en\u002F02.cli\u002F1.overview",{"title":56,"path":57,"stem":58,"icon":59},"add compose \u002F add docker","\u002Fen\u002Fcli\u002Fadd-compose","en\u002F02.cli\u002F10.add-compose","i-lucide-container",{"title":61,"path":62,"stem":63,"icon":64},"add mail","\u002Fen\u002Fcli\u002Fadd-mail","en\u002F02.cli\u002F11.add-mail","i-lucide-mail-plus",{"title":66,"path":67,"stem":68,"icon":69},"add notification","\u002Fen\u002Fcli\u002Fadd-notification","en\u002F02.cli\u002F12.add-notification","i-lucide-bell-plus",{"title":71,"path":72,"stem":73,"icon":74},"add realtime","\u002Fen\u002Fcli\u002Fadd-realtime","en\u002F02.cli\u002F13.add-realtime","i-lucide-radio-tower",{"title":76,"path":77,"stem":78,"icon":79},"add seeder","\u002Fen\u002Fcli\u002Fadd-seeder","en\u002F02.cli\u002F14.add-seeder","i-lucide-sprout",{"title":81,"path":82,"stem":83,"icon":84},"new project","\u002Fen\u002Fcli\u002Fnew-project","en\u002F02.cli\u002F2.new-project","i-lucide-folder-plus",{"title":86,"path":87,"stem":88,"icon":89},"new module","\u002Fen\u002Fcli\u002Fnew-module","en\u002F02.cli\u002F3.new-module","i-lucide-blocks",{"title":91,"path":92,"stem":93,"icon":94},"add surface","\u002Fen\u002Fcli\u002Fadd-surface","en\u002F02.cli\u002F4.add-surface","i-lucide-layers-2",{"title":96,"path":97,"stem":98,"icon":99},"add domain","\u002Fen\u002Fcli\u002Fadd-domain","en\u002F02.cli\u002F5.add-domain","i-lucide-box",{"title":101,"path":102,"stem":103,"icon":104},"add handler","\u002Fen\u002Fcli\u002Fadd-handler","en\u002F02.cli\u002F6.add-handler","i-lucide-webhook",{"title":106,"path":107,"stem":108,"icon":109},"new migration","\u002Fen\u002Fcli\u002Fnew-migration","en\u002F02.cli\u002F7.new-migration","i-lucide-file-plus",{"title":111,"path":112,"stem":113,"icon":114},"worker generators","\u002Fen\u002Fcli\u002Fworker-generators","en\u002F02.cli\u002F8.worker-generators","i-lucide-cog",{"title":116,"path":117,"stem":118,"icon":119},"add db","\u002Fen\u002Fcli\u002Fadd-db","en\u002F02.cli\u002F9.add-db","i-lucide-database-zap",{"title":121,"icon":99,"path":122,"stem":123,"children":124,"page":44},"Framework","\u002Fen\u002Fframework","en\u002F03.framework",[125,128,133,138,142,147,152],{"title":52,"path":126,"stem":127,"icon":99},"\u002Fen\u002Fframework\u002Foverview","en\u002F03.framework\u002F1.overview",{"title":129,"path":130,"stem":131,"icon":132},"Application lifecycle","\u002Fen\u002Fframework\u002Fapp","en\u002F03.framework\u002F2.app","i-lucide-power",{"title":134,"path":135,"stem":136,"icon":137},"Server","\u002Fen\u002Fframework\u002Fserver","en\u002F03.framework\u002F3.server","i-lucide-server",{"title":139,"path":140,"stem":141,"icon":114},"Worker","\u002Fen\u002Fframework\u002Fworker","en\u002F03.framework\u002F4.worker",{"title":143,"path":144,"stem":145,"icon":146},"Realtime","\u002Fen\u002Fframework\u002Frealtime","en\u002F03.framework\u002F5.realtime","i-lucide-radio",{"title":148,"path":149,"stem":150,"icon":151},"Migrations","\u002Fen\u002Fframework\u002Fmigrations","en\u002F03.framework\u002F6.migrations","i-lucide-file-stack",{"title":153,"path":154,"stem":155,"icon":156},"Social login","\u002Fen\u002Fframework\u002Fsocial-login","en\u002F03.framework\u002F7.social-login","i-lucide-log-in",{"title":158,"icon":159,"path":160,"stem":161,"children":162,"page":44},"Reference","i-lucide-book-open","\u002Fen\u002Freference","en\u002F04.reference",[163,168],{"title":164,"path":165,"stem":166,"icon":167},"Configuration","\u002Fen\u002Freference\u002Fconfiguration","en\u002F04.reference\u002F1.configuration","i-lucide-settings",{"title":169,"path":170,"stem":171,"icon":172},"External dependencies","\u002Fen\u002Freference\u002Fdependencies","en\u002F04.reference\u002F2.dependencies","i-lucide-package",{"title":174,"icon":175,"path":176,"stem":177,"children":178,"page":44},"Concepts","i-lucide-lightbulb","\u002Fen\u002Fconcepts","en\u002F05.concepts",[179,184,189,193,198],{"title":180,"path":181,"stem":182,"icon":183},"Architecture","\u002Fen\u002Fconcepts\u002Farchitecture","en\u002F05.concepts\u002F1.architecture","i-lucide-layers",{"title":185,"path":186,"stem":187,"icon":188},"Error model","\u002Fen\u002Fconcepts\u002Ferror-model","en\u002F05.concepts\u002F2.error-model","i-lucide-shield-alert",{"title":164,"path":190,"stem":191,"icon":192},"\u002Fen\u002Fconcepts\u002Fconfiguration","en\u002F05.concepts\u002F3.configuration","i-lucide-settings-2",{"title":194,"path":195,"stem":196,"icon":197},"Codegen pipeline","\u002Fen\u002Fconcepts\u002Fcodegen-pipeline","en\u002F05.concepts\u002F4.codegen-pipeline","i-lucide-file-json",{"title":199,"path":200,"stem":201,"icon":202},"Design patterns","\u002Fen\u002Fconcepts\u002Fdesign-patterns","en\u002F05.concepts\u002F5.design-patterns","i-lucide-puzzle",{"title":204,"icon":205,"path":206,"stem":207,"children":208,"page":44},"auth","i-lucide-shield-check","\u002Fen\u002Fauth","en\u002F06.auth",[209,214,219,224,229],{"title":210,"path":211,"stem":212,"icon":213},"Authentication","\u002Fen\u002Fauth\u002Foverview","en\u002F06.auth\u002F1.overview","i-lucide-key-round",{"title":215,"path":216,"stem":217,"icon":218},"RBAC","\u002Fen\u002Fauth\u002Frbac","en\u002F06.auth\u002F2.rbac","i-lucide-users",{"title":220,"path":221,"stem":222,"icon":223},"Policies","\u002Fen\u002Fauth\u002Fpolicy","en\u002F06.auth\u002F3.policy","i-lucide-gavel",{"title":225,"path":226,"stem":227,"icon":228},"Using auth standalone","\u002Fen\u002Fauth\u002Fstandalone","en\u002F06.auth\u002F4.standalone","i-lucide-plug",{"title":230,"path":231,"stem":232,"icon":156},"Social login with goth, standalone","\u002Fen\u002Fauth\u002Fsocial-standalone","en\u002F06.auth\u002F5.social-standalone",{"title":234,"icon":235,"path":236,"stem":237,"children":238,"page":44},"dbx","i-lucide-database","\u002Fen\u002Fdbx","en\u002F07.dbx",[239,242,246,250,255],{"title":52,"path":240,"stem":241,"icon":235},"\u002Fen\u002Fdbx\u002Foverview","en\u002F07.dbx\u002F1.overview",{"title":243,"path":244,"stem":245,"icon":228},"pgx","\u002Fen\u002Fdbx\u002Fpg","en\u002F07.dbx\u002F2.pg",{"title":247,"path":248,"stem":249,"icon":183},"bun","\u002Fen\u002Fdbx\u002Fbunx","en\u002F07.dbx\u002F3.bunx",{"title":251,"path":252,"stem":253,"icon":254},"Transactions","\u002Fen\u002Fdbx\u002Ftransactions","en\u002F07.dbx\u002F4.transactions","i-lucide-git-merge",{"title":256,"path":257,"stem":258,"icon":79},"Seeders","\u002Fen\u002Fdbx\u002Fseed","en\u002F07.dbx\u002F5.seed",{"title":260,"icon":192,"path":261,"stem":262,"children":263,"page":44},"envconf","\u002Fen\u002Fenvconf","en\u002F08.envconf",[264,267],{"title":52,"path":265,"stem":266,"icon":192},"\u002Fen\u002Fenvconf\u002Foverview","en\u002F08.envconf\u002F1.overview",{"title":268,"path":269,"stem":270,"icon":192},"Recipes","\u002Fen\u002Fenvconf\u002Frecipes","en\u002F08.envconf\u002F2.recipes",{"title":272,"icon":188,"path":273,"stem":274,"children":275,"page":44},"errs","\u002Fen\u002Ferrs","en\u002F09.errs",[276,279,283],{"title":52,"path":277,"stem":278,"icon":188},"\u002Fen\u002Ferrs\u002Foverview","en\u002F09.errs\u002F1.overview",{"title":280,"path":281,"stem":282,"icon":188},"API","\u002Fen\u002Ferrs\u002Fapi","en\u002F09.errs\u002F2.api",{"title":284,"path":285,"stem":286,"icon":188},"Integration","\u002Fen\u002Ferrs\u002Fintegration","en\u002F09.errs\u002F3.integration",{"title":288,"icon":289,"path":290,"stem":291,"children":292,"page":44},"events","i-lucide-workflow","\u002Fen\u002Fevents","en\u002F10.events",[293,297,302],{"title":294,"path":295,"stem":296,"icon":146},"Events","\u002Fen\u002Fevents\u002Foverview","en\u002F10.events\u002F1.overview",{"title":298,"path":299,"stem":300,"icon":301},"Outbox","\u002Fen\u002Fevents\u002Foutbox","en\u002F10.events\u002F2.outbox","i-lucide-inbox",{"title":303,"path":304,"stem":305,"icon":306},"Scheduling","\u002Fen\u002Fevents\u002Fscheduler","en\u002F10.events\u002F3.scheduler","i-lucide-calendar-clock",{"title":308,"icon":309,"path":310,"stem":311,"children":312,"page":44},"httperr","i-lucide-globe","\u002Fen\u002Fhttperr","en\u002F11.httperr",[313,316,321],{"title":52,"path":314,"stem":315,"icon":309},"\u002Fen\u002Fhttperr\u002Foverview","en\u002F11.httperr\u002F1.overview",{"title":317,"path":318,"stem":319,"icon":320},"Error responses","\u002Fen\u002Fhttperr\u002Ferror-responses","en\u002F11.httperr\u002F2.error-responses","i-lucide-octagon-alert",{"title":322,"path":323,"stem":324,"icon":325},"Validation","\u002Fen\u002Fhttperr\u002Fvalidation","en\u002F11.httperr\u002F3.validation","i-lucide-badge-check",{"title":327,"icon":328,"path":329,"stem":330,"children":331,"page":44},"logx","i-lucide-scroll-text","\u002Fen\u002Flogx","en\u002F12.logx",[332,335],{"title":52,"path":333,"stem":334,"icon":328},"\u002Fen\u002Flogx\u002Foverview","en\u002F12.logx\u002F1.overview",{"title":336,"path":337,"stem":338,"icon":47},"Monolog formatter","\u002Fen\u002Flogx\u002Fmonolog","en\u002F12.logx\u002F2.monolog",{"title":340,"icon":341,"path":342,"stem":343,"children":344,"page":44},"mail","i-lucide-mail","\u002Fen\u002Fmail","en\u002F13.mail",[345,348,352],{"title":52,"path":346,"stem":347,"icon":341},"\u002Fen\u002Fmail\u002Foverview","en\u002F13.mail\u002F1.overview",{"title":349,"path":350,"stem":351,"icon":341},"SMTP","\u002Fen\u002Fmail\u002Fsmtp","en\u002F13.mail\u002F2.smtp",{"title":353,"path":354,"stem":355,"icon":341},"MJML","\u002Fen\u002Fmail\u002Fmjml","en\u002F13.mail\u002F3.mjml",{"title":357,"icon":358,"path":359,"stem":360,"children":361,"page":44},"notify","i-lucide-bell","\u002Fen\u002Fnotify","en\u002F14.notify",[362,365,369],{"title":52,"path":363,"stem":364,"icon":358},"\u002Fen\u002Fnotify\u002Foverview","en\u002F14.notify\u002F1.overview",{"title":366,"path":367,"stem":368,"icon":358},"Database channel","\u002Fen\u002Fnotify\u002Fdatabase","en\u002F14.notify\u002F2.database",{"title":370,"path":371,"stem":372,"icon":358},"Broadcast channel","\u002Fen\u002Fnotify\u002Fbroadcast","en\u002F14.notify\u002F3.broadcast",{"title":374,"icon":375,"path":376,"stem":377,"children":378,"page":44},"paginate","i-lucide-list-ordered","\u002Fen\u002Fpaginate","en\u002F15.paginate",[379,382],{"title":52,"path":380,"stem":381,"icon":375},"\u002Fen\u002Fpaginate\u002Foverview","en\u002F15.paginate\u002F1.overview",{"title":383,"path":384,"stem":385,"icon":39},"Cursor pagination","\u002Fen\u002Fpaginate\u002Fcursor","en\u002F15.paginate\u002F2.cursor",{"title":387,"icon":183,"path":388,"stem":389,"children":390,"page":44},"queue","\u002Fen\u002Fqueue","en\u002F16.queue",[391,394],{"title":52,"path":392,"stem":393,"icon":375},"\u002Fen\u002Fqueue\u002Foverview","en\u002F16.queue\u002F1.overview",{"title":395,"path":396,"stem":397,"icon":183},"Tasks","\u002Fen\u002Fqueue\u002Ftasks","en\u002F16.queue\u002F2.tasks",{"title":399,"icon":400,"path":401,"stem":402,"children":403,"page":44},"storage","i-lucide-hard-drive","\u002Fen\u002Fstorage","en\u002F17.storage",[404,407,411,415,420],{"title":52,"path":405,"stem":406,"icon":400},"\u002Fen\u002Fstorage\u002Foverview","en\u002F17.storage\u002F1.overview",{"title":408,"path":409,"stem":410,"icon":400},"Disk API","\u002Fen\u002Fstorage\u002Fdisk-api","en\u002F17.storage\u002F2.disk-api",{"title":412,"path":413,"stem":414,"icon":400},"Memory and local disk","\u002Fen\u002Fstorage\u002Flocal","en\u002F17.storage\u002F3.local",{"title":416,"path":417,"stem":418,"icon":419},"S3","\u002Fen\u002Fstorage\u002Fs3","en\u002F17.storage\u002F4.s3","i-lucide-cloud",{"title":421,"path":422,"stem":423,"icon":424},"Testing","\u002Fen\u002Fstorage\u002Ftesting","en\u002F17.storage\u002F5.testing","i-lucide-flask-conical",{"title":426,"icon":427,"path":428,"stem":429,"children":430,"page":44},"telemetry","i-lucide-activity","\u002Fen\u002Ftelemetry","en\u002F18.telemetry",[431,434,438,443],{"title":52,"path":432,"stem":433,"icon":427},"\u002Fen\u002Ftelemetry\u002Foverview","en\u002F18.telemetry\u002F1.overview",{"title":435,"path":436,"stem":437,"icon":328},"Logging","\u002Fen\u002Ftelemetry\u002Flogging","en\u002F18.telemetry\u002F2.logging",{"title":439,"path":440,"stem":441,"icon":442},"OpenTelemetry","\u002Fen\u002Ftelemetry\u002Fopentelemetry","en\u002F18.telemetry\u002F3.opentelemetry","i-lucide-radar",{"title":444,"path":445,"stem":446,"icon":447},"Sentry","\u002Fen\u002Ftelemetry\u002Fsentry","en\u002F18.telemetry\u002F4.sentry","i-lucide-bug",{"id":449,"title":280,"body":450,"description":2546,"extension":2547,"links":2548,"meta":2549,"navigation":2550,"path":281,"seo":2551,"stem":282,"__hash__":2552},"docs_en\u002Fen\u002F09.errs\u002F2.api.md",{"type":451,"value":452,"toc":2536},"minimark",[453,481,510,515,694,769,960,964,973,1088,1220,1238,1242,1300,1320,1324,1520,1563,1567,1599,1603,1823,1842,1911,1953,1957,2493,2497,2532],[454,455,456,457,460,461,464,465,468,469,472,473,476,477,480],"p",{},"The full ",[458,459,272],"code",{}," surface: five constructors, four attribute functions, three accessors, and ",[458,462,463],{},"Define"," for naming a failure mode once and reusing it everywhere. Everything here works with plain ",[458,466,467],{},"errors.Is","\u002F",[458,470,471],{},"errors.As",", because ",[458,474,475],{},"*errs.Error"," wraps like any other Go error. See ",[478,479,52],"a",{"href":277}," for install and the two-message design principle this API is built around.",[482,483,488],"pre",{"className":484,"code":485,"language":486,"meta":487,"style":487},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import \"github.com\u002Fgp-system\u002Ferrs\"\n","go","",[458,489,490],{"__ignoreMap":487},[491,492,495,499,503,507],"span",{"class":493,"line":494},"line",1,[491,496,498],{"class":497},"s7zQu","import",[491,500,502],{"class":501},"sMK4o"," \"",[491,504,506],{"class":505},"sBMFI","github.com\u002Fgp-system\u002Ferrs",[491,508,509],{"class":501},"\"\n",[511,512,514],"h2",{"id":513},"constructors","Constructors",[482,516,518],{"className":484,"code":517,"language":486,"meta":487,"style":487},"func New(msg string, attrs ...Attr) *Error\nfunc Errorf(format string, args ...any) *Error\nfunc Wrap(err error, msg string, attrs ...Attr) *Error\nfunc Wrapf(err error, format string, args ...any) *Error\nfunc NewPanic(recovered any, attrs ...Attr) *Error\n",[458,519,520,561,592,629,664],{"__ignoreMap":487},[491,521,522,525,529,532,536,540,543,546,549,552,555,558],{"class":493,"line":494},[491,523,524],{"class":501},"func",[491,526,528],{"class":527},"s2Zo4"," New",[491,530,531],{"class":501},"(",[491,533,535],{"class":534},"sHdIc","msg",[491,537,539],{"class":538},"spNyl"," string",[491,541,542],{"class":501},",",[491,544,545],{"class":534}," attrs",[491,547,548],{"class":501}," ...",[491,550,551],{"class":505},"Attr",[491,553,554],{"class":501},")",[491,556,557],{"class":501}," *",[491,559,560],{"class":505},"Error\n",[491,562,564,566,569,571,574,576,578,581,583,586,588,590],{"class":493,"line":563},2,[491,565,524],{"class":501},[491,567,568],{"class":527}," Errorf",[491,570,531],{"class":501},[491,572,573],{"class":534},"format",[491,575,539],{"class":538},[491,577,542],{"class":501},[491,579,580],{"class":534}," args",[491,582,548],{"class":501},[491,584,585],{"class":505},"any",[491,587,554],{"class":501},[491,589,557],{"class":501},[491,591,560],{"class":505},[491,593,595,597,600,602,605,608,610,613,615,617,619,621,623,625,627],{"class":493,"line":594},3,[491,596,524],{"class":501},[491,598,599],{"class":527}," Wrap",[491,601,531],{"class":501},[491,603,604],{"class":534},"err",[491,606,607],{"class":538}," error",[491,609,542],{"class":501},[491,611,612],{"class":534}," msg",[491,614,539],{"class":538},[491,616,542],{"class":501},[491,618,545],{"class":534},[491,620,548],{"class":501},[491,622,551],{"class":505},[491,624,554],{"class":501},[491,626,557],{"class":501},[491,628,560],{"class":505},[491,630,632,634,637,639,641,643,645,648,650,652,654,656,658,660,662],{"class":493,"line":631},4,[491,633,524],{"class":501},[491,635,636],{"class":527}," Wrapf",[491,638,531],{"class":501},[491,640,604],{"class":534},[491,642,607],{"class":538},[491,644,542],{"class":501},[491,646,647],{"class":534}," format",[491,649,539],{"class":538},[491,651,542],{"class":501},[491,653,580],{"class":534},[491,655,548],{"class":501},[491,657,585],{"class":505},[491,659,554],{"class":501},[491,661,557],{"class":501},[491,663,560],{"class":505},[491,665,667,669,672,674,677,680,682,684,686,688,690,692],{"class":493,"line":666},5,[491,668,524],{"class":501},[491,670,671],{"class":527}," NewPanic",[491,673,531],{"class":501},[491,675,676],{"class":534},"recovered",[491,678,679],{"class":505}," any",[491,681,542],{"class":501},[491,683,545],{"class":534},[491,685,548],{"class":501},[491,687,551],{"class":505},[491,689,554],{"class":501},[491,691,557],{"class":501},[491,693,560],{"class":505},[695,696,697,707,722,744,754],"ul",{},[698,699,700,706],"li",{},[701,702,703],"strong",{},[458,704,705],{},"New"," starts a fresh error, capturing the stack at the call site.",[698,708,709,714,715,717,718,721],{},[701,710,711],{},[458,712,713],{},"Errorf"," is ",[458,716,705],{}," with ",[458,719,720],{},"fmt.Sprintf","-style formatting, no attributes.",[698,723,724,729,730,733,734,736,737,740,741,743],{},[701,725,726],{},[458,727,728],{},"Wrap"," attaches a new message to an existing error, keeping the original as the cause; ",[458,731,732],{},"nil"," in, ",[458,735,732],{}," out, so ",[458,738,739],{},"errs.Wrap(err, \"...\")"," is safe to call unconditionally on a possibly-nil ",[458,742,604],{},".",[698,745,746,714,751,753],{},[701,747,748],{},[458,749,750],{},"Wrapf",[458,752,728],{}," with formatting.",[698,755,756,761,762,764,765,768],{},[701,757,758],{},[458,759,760],{},"NewPanic"," turns a recovered panic value into an ",[458,763,475],{}," whose stack points at the panic site, for use in a ",[458,766,767],{},"recover()"," handler.",[482,770,772],{"className":484,"code":771,"language":486,"meta":487,"style":487},"if err := repo.Save(ctx, order); err != nil {\n    return errs.Wrap(err, \"orders: save\", errs.With(\"order_id\", order.ID))\n}\n\nif err := validateQuantity(qty); err != nil {\n    return errs.Errorf(\"invalid quantity %d: %w\", qty, err)\n}\n",[458,773,774,818,875,880,886,912,955],{"__ignoreMap":487},[491,775,776,779,783,786,789,791,794,796,799,801,804,807,809,812,815],{"class":493,"line":494},[491,777,778],{"class":497},"if",[491,780,782],{"class":781},"sTEyZ"," err ",[491,784,785],{"class":501},":=",[491,787,788],{"class":781}," repo",[491,790,743],{"class":501},[491,792,793],{"class":527},"Save",[491,795,531],{"class":501},[491,797,798],{"class":781},"ctx",[491,800,542],{"class":501},[491,802,803],{"class":781}," order",[491,805,806],{"class":501},");",[491,808,782],{"class":781},[491,810,811],{"class":501},"!=",[491,813,814],{"class":501}," nil",[491,816,817],{"class":501}," {\n",[491,819,820,823,826,828,830,832,834,836,838,842,845,847,849,851,854,856,858,861,863,865,867,869,872],{"class":493,"line":563},[491,821,822],{"class":497},"    return",[491,824,825],{"class":781}," errs",[491,827,743],{"class":501},[491,829,728],{"class":527},[491,831,531],{"class":501},[491,833,604],{"class":781},[491,835,542],{"class":501},[491,837,502],{"class":501},[491,839,841],{"class":840},"sfazB","orders: save",[491,843,844],{"class":501},"\"",[491,846,542],{"class":501},[491,848,825],{"class":781},[491,850,743],{"class":501},[491,852,853],{"class":527},"With",[491,855,531],{"class":501},[491,857,844],{"class":501},[491,859,860],{"class":840},"order_id",[491,862,844],{"class":501},[491,864,542],{"class":501},[491,866,803],{"class":781},[491,868,743],{"class":501},[491,870,871],{"class":781},"ID",[491,873,874],{"class":501},"))\n",[491,876,877],{"class":493,"line":594},[491,878,879],{"class":501},"}\n",[491,881,882],{"class":493,"line":631},[491,883,885],{"emptyLinePlaceholder":884},true,"\n",[491,887,888,890,892,894,897,899,902,904,906,908,910],{"class":493,"line":666},[491,889,778],{"class":497},[491,891,782],{"class":781},[491,893,785],{"class":501},[491,895,896],{"class":527}," validateQuantity",[491,898,531],{"class":501},[491,900,901],{"class":781},"qty",[491,903,806],{"class":501},[491,905,782],{"class":781},[491,907,811],{"class":501},[491,909,814],{"class":501},[491,911,817],{"class":501},[491,913,915,917,919,921,923,925,927,930,934,937,940,942,944,947,949,952],{"class":493,"line":914},6,[491,916,822],{"class":497},[491,918,825],{"class":781},[491,920,743],{"class":501},[491,922,713],{"class":527},[491,924,531],{"class":501},[491,926,844],{"class":501},[491,928,929],{"class":840},"invalid quantity ",[491,931,933],{"class":932},"swJcz","%d",[491,935,936],{"class":840},": ",[491,938,939],{"class":932},"%w",[491,941,844],{"class":501},[491,943,542],{"class":501},[491,945,946],{"class":781}," qty",[491,948,542],{"class":501},[491,950,951],{"class":781}," err",[491,953,954],{"class":501},")\n",[491,956,958],{"class":493,"line":957},7,[491,959,879],{"class":501},[511,961,963],{"id":962},"attributes","Attributes",[454,965,966,968,969,972],{},[458,967,551],{}," is a ",[458,970,971],{},"func(*Error)",", applied in order to any constructor:",[482,974,976],{"className":484,"code":975,"language":486,"meta":487,"style":487},"type Attr func(*Error)\n\nfunc Code(code string) Attr    \u002F\u002F machine-readable identifier, stable across message rewording\nfunc Public(msg string) Attr   \u002F\u002F the only text a client is ever allowed to see\nfunc Status(code int) Attr     \u002F\u002F the HTTP-shaped status this failure maps to\nfunc With(key string, value any) Attr \u002F\u002F structured metadata, attached at this wrap level\n",[458,977,978,994,998,1019,1039,1060],{"__ignoreMap":487},[491,979,980,983,986,989,992],{"class":493,"line":494},[491,981,982],{"class":501},"type",[491,984,985],{"class":505}," Attr",[491,987,988],{"class":501}," func(*",[491,990,991],{"class":505},"Error",[491,993,954],{"class":501},[491,995,996],{"class":493,"line":563},[491,997,885],{"emptyLinePlaceholder":884},[491,999,1000,1002,1005,1007,1009,1011,1013,1015],{"class":493,"line":594},[491,1001,524],{"class":501},[491,1003,1004],{"class":527}," Code",[491,1006,531],{"class":501},[491,1008,458],{"class":534},[491,1010,539],{"class":538},[491,1012,554],{"class":501},[491,1014,985],{"class":505},[491,1016,1018],{"class":1017},"sHwdD","    \u002F\u002F machine-readable identifier, stable across message rewording\n",[491,1020,1021,1023,1026,1028,1030,1032,1034,1036],{"class":493,"line":631},[491,1022,524],{"class":501},[491,1024,1025],{"class":527}," Public",[491,1027,531],{"class":501},[491,1029,535],{"class":534},[491,1031,539],{"class":538},[491,1033,554],{"class":501},[491,1035,985],{"class":505},[491,1037,1038],{"class":1017},"   \u002F\u002F the only text a client is ever allowed to see\n",[491,1040,1041,1043,1046,1048,1050,1053,1055,1057],{"class":493,"line":666},[491,1042,524],{"class":501},[491,1044,1045],{"class":527}," Status",[491,1047,531],{"class":501},[491,1049,458],{"class":534},[491,1051,1052],{"class":538}," int",[491,1054,554],{"class":501},[491,1056,985],{"class":505},[491,1058,1059],{"class":1017},"     \u002F\u002F the HTTP-shaped status this failure maps to\n",[491,1061,1062,1064,1067,1069,1072,1074,1076,1079,1081,1083,1085],{"class":493,"line":914},[491,1063,524],{"class":501},[491,1065,1066],{"class":527}," With",[491,1068,531],{"class":501},[491,1070,1071],{"class":534},"key",[491,1073,539],{"class":538},[491,1075,542],{"class":501},[491,1077,1078],{"class":534}," value",[491,1080,679],{"class":505},[491,1082,554],{"class":501},[491,1084,985],{"class":505},[491,1086,1087],{"class":1017}," \u002F\u002F structured metadata, attached at this wrap level\n",[482,1089,1091],{"className":484,"code":1090,"language":486,"meta":487,"style":487},"var ErrOutOfStock = errs.Define(\"out_of_stock\",\n    errs.Public(\"The product is out of stock.\"),\n    errs.Status(http.StatusConflict))\n\nerr := ErrOutOfStock.New(\"orders: decrement stock\", errs.With(\"product_id\", \"prod_42\"))\n",[458,1092,1093,1122,1144,1165,1169],{"__ignoreMap":487},[491,1094,1095,1098,1101,1104,1106,1108,1110,1112,1114,1117,1119],{"class":493,"line":494},[491,1096,1097],{"class":501},"var",[491,1099,1100],{"class":781}," ErrOutOfStock ",[491,1102,1103],{"class":501},"=",[491,1105,825],{"class":781},[491,1107,743],{"class":501},[491,1109,463],{"class":527},[491,1111,531],{"class":501},[491,1113,844],{"class":501},[491,1115,1116],{"class":840},"out_of_stock",[491,1118,844],{"class":501},[491,1120,1121],{"class":501},",\n",[491,1123,1124,1127,1129,1132,1134,1136,1139,1141],{"class":493,"line":563},[491,1125,1126],{"class":781},"    errs",[491,1128,743],{"class":501},[491,1130,1131],{"class":527},"Public",[491,1133,531],{"class":501},[491,1135,844],{"class":501},[491,1137,1138],{"class":840},"The product is out of stock.",[491,1140,844],{"class":501},[491,1142,1143],{"class":501},"),\n",[491,1145,1146,1148,1150,1153,1155,1158,1160,1163],{"class":493,"line":594},[491,1147,1126],{"class":781},[491,1149,743],{"class":501},[491,1151,1152],{"class":527},"Status",[491,1154,531],{"class":501},[491,1156,1157],{"class":781},"http",[491,1159,743],{"class":501},[491,1161,1162],{"class":781},"StatusConflict",[491,1164,874],{"class":501},[491,1166,1167],{"class":493,"line":631},[491,1168,885],{"emptyLinePlaceholder":884},[491,1170,1171,1174,1176,1179,1181,1183,1185,1187,1190,1192,1194,1196,1198,1200,1202,1204,1207,1209,1211,1213,1216,1218],{"class":493,"line":666},[491,1172,1173],{"class":781},"err ",[491,1175,785],{"class":501},[491,1177,1178],{"class":781}," ErrOutOfStock",[491,1180,743],{"class":501},[491,1182,705],{"class":527},[491,1184,531],{"class":501},[491,1186,844],{"class":501},[491,1188,1189],{"class":840},"orders: decrement stock",[491,1191,844],{"class":501},[491,1193,542],{"class":501},[491,1195,825],{"class":781},[491,1197,743],{"class":501},[491,1199,853],{"class":527},[491,1201,531],{"class":501},[491,1203,844],{"class":501},[491,1205,1206],{"class":840},"product_id",[491,1208,844],{"class":501},[491,1210,542],{"class":501},[491,1212,502],{"class":501},[491,1214,1215],{"class":840},"prod_42",[491,1217,844],{"class":501},[491,1219,874],{"class":501},[454,1221,1222,1225,1226,1228,1229,1231,1232,1234,1235,1237],{},[458,1223,1224],{},"Code",", ",[458,1227,1131],{}," and ",[458,1230,1152],{}," are usually set once, on a ",[458,1233,463],{},"d definition; ",[458,1236,853],{}," is the one attribute you reach for at every individual wrap site, to attach the metadata specific to that call (an ID, a count, a query name).",[511,1239,1241],{"id":1240},"accessors","Accessors",[482,1243,1245],{"className":484,"code":1244,"language":486,"meta":487,"style":487},"func CodeOf(err error) string\nfunc PublicOf(err error) string\nfunc StatusOf(err error) int\n",[458,1246,1247,1265,1282],{"__ignoreMap":487},[491,1248,1249,1251,1254,1256,1258,1260,1262],{"class":493,"line":494},[491,1250,524],{"class":501},[491,1252,1253],{"class":527}," CodeOf",[491,1255,531],{"class":501},[491,1257,604],{"class":534},[491,1259,607],{"class":538},[491,1261,554],{"class":501},[491,1263,1264],{"class":538}," string\n",[491,1266,1267,1269,1272,1274,1276,1278,1280],{"class":493,"line":563},[491,1268,524],{"class":501},[491,1270,1271],{"class":527}," PublicOf",[491,1273,531],{"class":501},[491,1275,604],{"class":534},[491,1277,607],{"class":538},[491,1279,554],{"class":501},[491,1281,1264],{"class":538},[491,1283,1284,1286,1289,1291,1293,1295,1297],{"class":493,"line":594},[491,1285,524],{"class":501},[491,1287,1288],{"class":527}," StatusOf",[491,1290,531],{"class":501},[491,1292,604],{"class":534},[491,1294,607],{"class":538},[491,1296,554],{"class":501},[491,1298,1299],{"class":538}," int\n",[454,1301,1302,1303,1305,1306,1308,1309,1311,1312,1315,1316,1319],{},"Each walks the error chain (via ",[458,1304,471],{},") looking for the first ",[458,1307,475],{}," that set the corresponding attribute, so it works the same whether the error you hand it is the ",[458,1310,475],{}," itself or something that wraps one further up. ",[458,1313,1314],{},"StatusOf"," returns ",[458,1317,1318],{},"0"," when nothing in the chain set a status, so a renderer can fall back to 500 explicitly rather than guessing.",[511,1321,1323],{"id":1322},"introspection-frames-fullframes-chain","Introspection: Frames, FullFrames, Chain",[482,1325,1327],{"className":484,"code":1326,"language":486,"meta":487,"style":487},"type Frame struct {\n    File     string\n    Line     int\n    Function string\n}\n\ntype Step struct {\n    Msg      string\n    File     string\n    Line     int\n    Function string\n    Code     string\n    Meta     map[string]any\n}\n\nfunc Frames(err error) []Frame     \u002F\u002F the stack captured at the point of origin\nfunc FullFrames(err error) []Frame \u002F\u002F Frames, plus intermediate non-wrapping call frames\nfunc Chain(err error) []Step       \u002F\u002F one Step per wrap level, root cause last\n",[458,1328,1329,1341,1349,1357,1364,1368,1372,1383,1391,1398,1405,1412,1420,1438,1443,1448,1473,1496],{"__ignoreMap":487},[491,1330,1331,1333,1336,1339],{"class":493,"line":494},[491,1332,982],{"class":501},[491,1334,1335],{"class":505}," Frame",[491,1337,1338],{"class":501}," struct",[491,1340,817],{"class":501},[491,1342,1343,1346],{"class":493,"line":563},[491,1344,1345],{"class":781},"    File     ",[491,1347,1348],{"class":538},"string\n",[491,1350,1351,1354],{"class":493,"line":594},[491,1352,1353],{"class":781},"    Line     ",[491,1355,1356],{"class":538},"int\n",[491,1358,1359,1362],{"class":493,"line":631},[491,1360,1361],{"class":781},"    Function ",[491,1363,1348],{"class":538},[491,1365,1366],{"class":493,"line":666},[491,1367,879],{"class":501},[491,1369,1370],{"class":493,"line":914},[491,1371,885],{"emptyLinePlaceholder":884},[491,1373,1374,1376,1379,1381],{"class":493,"line":957},[491,1375,982],{"class":501},[491,1377,1378],{"class":505}," Step",[491,1380,1338],{"class":501},[491,1382,817],{"class":501},[491,1384,1386,1389],{"class":493,"line":1385},8,[491,1387,1388],{"class":781},"    Msg      ",[491,1390,1348],{"class":538},[491,1392,1394,1396],{"class":493,"line":1393},9,[491,1395,1345],{"class":781},[491,1397,1348],{"class":538},[491,1399,1401,1403],{"class":493,"line":1400},10,[491,1402,1353],{"class":781},[491,1404,1356],{"class":538},[491,1406,1408,1410],{"class":493,"line":1407},11,[491,1409,1361],{"class":781},[491,1411,1348],{"class":538},[491,1413,1415,1418],{"class":493,"line":1414},12,[491,1416,1417],{"class":781},"    Code     ",[491,1419,1348],{"class":538},[491,1421,1423,1426,1429,1432,1435],{"class":493,"line":1422},13,[491,1424,1425],{"class":781},"    Meta     ",[491,1427,1428],{"class":501},"map[",[491,1430,1431],{"class":538},"string",[491,1433,1434],{"class":501},"]",[491,1436,1437],{"class":505},"any\n",[491,1439,1441],{"class":493,"line":1440},14,[491,1442,879],{"class":501},[491,1444,1446],{"class":493,"line":1445},15,[491,1447,885],{"emptyLinePlaceholder":884},[491,1449,1451,1453,1456,1458,1460,1462,1464,1467,1470],{"class":493,"line":1450},16,[491,1452,524],{"class":501},[491,1454,1455],{"class":527}," Frames",[491,1457,531],{"class":501},[491,1459,604],{"class":534},[491,1461,607],{"class":538},[491,1463,554],{"class":501},[491,1465,1466],{"class":501}," []",[491,1468,1469],{"class":505},"Frame",[491,1471,1472],{"class":1017},"     \u002F\u002F the stack captured at the point of origin\n",[491,1474,1476,1478,1481,1483,1485,1487,1489,1491,1493],{"class":493,"line":1475},17,[491,1477,524],{"class":501},[491,1479,1480],{"class":527}," FullFrames",[491,1482,531],{"class":501},[491,1484,604],{"class":534},[491,1486,607],{"class":538},[491,1488,554],{"class":501},[491,1490,1466],{"class":501},[491,1492,1469],{"class":505},[491,1494,1495],{"class":1017}," \u002F\u002F Frames, plus intermediate non-wrapping call frames\n",[491,1497,1499,1501,1504,1506,1508,1510,1512,1514,1517],{"class":493,"line":1498},18,[491,1500,524],{"class":501},[491,1502,1503],{"class":527}," Chain",[491,1505,531],{"class":501},[491,1507,604],{"class":534},[491,1509,607],{"class":538},[491,1511,554],{"class":501},[491,1513,1466],{"class":501},[491,1515,1516],{"class":505},"Step",[491,1518,1519],{"class":1017},"       \u002F\u002F one Step per wrap level, root cause last\n",[454,1521,1522,1525,1526,1225,1528,1530,1531,1533,1534,1537,1538,1541,1542,1544,1545,468,1547,1549,1550,468,1552,1554,1555,1228,1559,1562],{},[458,1523,1524],{},"Frames"," is the call stack at the moment the error was first created (",[458,1527,705],{},[458,1529,713],{}," or the first ",[458,1532,728],{}," in the chain); ",[458,1535,1536],{},"FullFrames"," additionally includes frames of ordinary function calls that neither created nor wrapped the error, giving the complete call path. ",[458,1539,1540],{},"Chain"," is the wrap history: one ",[458,1543,1516],{}," per ",[458,1546,728],{},[458,1548,750],{}," call, each with its own message, wrap site and whatever ",[458,1551,853],{},[458,1553,1224],{}," was attached there, ending in the innermost cause. These three functions are what ",[478,1556,1558],{"href":1557},"\u002Fen\u002Ferrs\u002Fintegration#log-output","logging",[478,1560,444],{"href":1561},"\u002Fen\u002Ferrs\u002Fintegration#sentry"," build their structured output from; you rarely call them directly outside of that.",[511,1564,1566],{"id":1565},"stack-semantics-captured-at-creation","Stack semantics: captured at creation",[454,1568,1569,1570,1573,1574,468,1576,1578,1579,468,1581,1583,1584,1586,1587,1590,1591,1593,1594,1596,1597,743],{},"The stack trace is captured ",[701,1571,1572],{},"once",", at the ",[458,1575,705],{},[458,1577,713],{},"\u002Ffirst-",[458,1580,728],{},[458,1582,760],{}," call that creates the ",[458,1585,475],{},", using ",[458,1588,1589],{},"runtime.Callers",". Later ",[458,1592,728],{}," calls on the same error add a ",[458,1595,1516],{}," to the chain but do not recapture the stack: the stack always points at the point of origin, not at whatever call site happens to log it. This matters in practice: if you captured the stack when you logged instead of when you created the error, a deeply wrapped error would point at the logging call, the same line, every time, regardless of where the failure actually started. Capturing at creation means the stack is meaningful the one time it matters, and free every other time the error is passed around, wrapped or checked with ",[458,1598,467],{},[511,1600,1602],{"id":1601},"errsdefine-named-failure-modes","errs.Define: named failure modes",[482,1604,1606],{"className":484,"code":1605,"language":486,"meta":487,"style":487},"type Definition struct { \u002F* ... *\u002F }\n\nfunc Define(code string, attrs ...Attr) *Definition\n\nfunc (d *Definition) New(msg string, attrs ...Attr) *Error\nfunc (d *Definition) Newf(format string, args ...any) *Error\nfunc (d *Definition) Wrap(err error, msg string, attrs ...Attr) *Error\nfunc (d *Definition) Wrapf(err error, format string, args ...any) *Error\n",[458,1607,1608,1626,1630,1658,1662,1702,1739,1781],{"__ignoreMap":487},[491,1609,1610,1612,1615,1617,1620,1623],{"class":493,"line":494},[491,1611,982],{"class":501},[491,1613,1614],{"class":505}," Definition",[491,1616,1338],{"class":501},[491,1618,1619],{"class":501}," {",[491,1621,1622],{"class":1017}," \u002F* ... *\u002F",[491,1624,1625],{"class":501}," }\n",[491,1627,1628],{"class":493,"line":563},[491,1629,885],{"emptyLinePlaceholder":884},[491,1631,1632,1634,1637,1639,1641,1643,1645,1647,1649,1651,1653,1655],{"class":493,"line":594},[491,1633,524],{"class":501},[491,1635,1636],{"class":527}," Define",[491,1638,531],{"class":501},[491,1640,458],{"class":534},[491,1642,539],{"class":538},[491,1644,542],{"class":501},[491,1646,545],{"class":534},[491,1648,548],{"class":501},[491,1650,551],{"class":505},[491,1652,554],{"class":501},[491,1654,557],{"class":501},[491,1656,1657],{"class":505},"Definition\n",[491,1659,1660],{"class":493,"line":631},[491,1661,885],{"emptyLinePlaceholder":884},[491,1663,1664,1666,1669,1672,1675,1678,1680,1682,1684,1686,1688,1690,1692,1694,1696,1698,1700],{"class":493,"line":666},[491,1665,524],{"class":501},[491,1667,1668],{"class":501}," (",[491,1670,1671],{"class":534},"d ",[491,1673,1674],{"class":501},"*",[491,1676,1677],{"class":505},"Definition",[491,1679,554],{"class":501},[491,1681,528],{"class":527},[491,1683,531],{"class":501},[491,1685,535],{"class":534},[491,1687,539],{"class":538},[491,1689,542],{"class":501},[491,1691,545],{"class":534},[491,1693,548],{"class":501},[491,1695,551],{"class":505},[491,1697,554],{"class":501},[491,1699,557],{"class":501},[491,1701,560],{"class":505},[491,1703,1704,1706,1708,1710,1712,1714,1716,1719,1721,1723,1725,1727,1729,1731,1733,1735,1737],{"class":493,"line":914},[491,1705,524],{"class":501},[491,1707,1668],{"class":501},[491,1709,1671],{"class":534},[491,1711,1674],{"class":501},[491,1713,1677],{"class":505},[491,1715,554],{"class":501},[491,1717,1718],{"class":527}," Newf",[491,1720,531],{"class":501},[491,1722,573],{"class":534},[491,1724,539],{"class":538},[491,1726,542],{"class":501},[491,1728,580],{"class":534},[491,1730,548],{"class":501},[491,1732,585],{"class":505},[491,1734,554],{"class":501},[491,1736,557],{"class":501},[491,1738,560],{"class":505},[491,1740,1741,1743,1745,1747,1749,1751,1753,1755,1757,1759,1761,1763,1765,1767,1769,1771,1773,1775,1777,1779],{"class":493,"line":957},[491,1742,524],{"class":501},[491,1744,1668],{"class":501},[491,1746,1671],{"class":534},[491,1748,1674],{"class":501},[491,1750,1677],{"class":505},[491,1752,554],{"class":501},[491,1754,599],{"class":527},[491,1756,531],{"class":501},[491,1758,604],{"class":534},[491,1760,607],{"class":538},[491,1762,542],{"class":501},[491,1764,612],{"class":534},[491,1766,539],{"class":538},[491,1768,542],{"class":501},[491,1770,545],{"class":534},[491,1772,548],{"class":501},[491,1774,551],{"class":505},[491,1776,554],{"class":501},[491,1778,557],{"class":501},[491,1780,560],{"class":505},[491,1782,1783,1785,1787,1789,1791,1793,1795,1797,1799,1801,1803,1805,1807,1809,1811,1813,1815,1817,1819,1821],{"class":493,"line":1385},[491,1784,524],{"class":501},[491,1786,1668],{"class":501},[491,1788,1671],{"class":534},[491,1790,1674],{"class":501},[491,1792,1677],{"class":505},[491,1794,554],{"class":501},[491,1796,636],{"class":527},[491,1798,531],{"class":501},[491,1800,604],{"class":534},[491,1802,607],{"class":538},[491,1804,542],{"class":501},[491,1806,647],{"class":534},[491,1808,539],{"class":538},[491,1810,542],{"class":501},[491,1812,580],{"class":534},[491,1814,548],{"class":501},[491,1816,585],{"class":505},[491,1818,554],{"class":501},[491,1820,557],{"class":501},[491,1822,560],{"class":505},[454,1824,1825,1827,1828,1830,1831,1834,1835,1837,1838,1841],{},[458,1826,463],{}," declares a reusable failure mode once, as a package-level ",[458,1829,1097],{},", the same way you'd declare a sentinel error with ",[458,1832,1833],{},"errors.New",". It requires a ",[458,1836,1152],{}," attribute set to a valid 4xx or 5xx HTTP status code, and ",[701,1839,1840],{},"panics at init time"," if that's missing or out of range:",[482,1843,1845],{"className":484,"code":1844,"language":486,"meta":487,"style":487},"var ErrOutOfStock = errs.Define(\"out_of_stock\",\n    errs.Public(\"The product is out of stock.\"),\n    errs.Status(http.StatusConflict)) \u002F\u002F required, or Define panics\n",[458,1846,1847,1871,1889],{"__ignoreMap":487},[491,1848,1849,1851,1853,1855,1857,1859,1861,1863,1865,1867,1869],{"class":493,"line":494},[491,1850,1097],{"class":501},[491,1852,1100],{"class":781},[491,1854,1103],{"class":501},[491,1856,825],{"class":781},[491,1858,743],{"class":501},[491,1860,463],{"class":527},[491,1862,531],{"class":501},[491,1864,844],{"class":501},[491,1866,1116],{"class":840},[491,1868,844],{"class":501},[491,1870,1121],{"class":501},[491,1872,1873,1875,1877,1879,1881,1883,1885,1887],{"class":493,"line":563},[491,1874,1126],{"class":781},[491,1876,743],{"class":501},[491,1878,1131],{"class":527},[491,1880,531],{"class":501},[491,1882,844],{"class":501},[491,1884,1138],{"class":840},[491,1886,844],{"class":501},[491,1888,1143],{"class":501},[491,1890,1891,1893,1895,1897,1899,1901,1903,1905,1908],{"class":493,"line":594},[491,1892,1126],{"class":781},[491,1894,743],{"class":501},[491,1896,1152],{"class":527},[491,1898,531],{"class":501},[491,1900,1157],{"class":781},[491,1902,743],{"class":501},[491,1904,1162],{"class":781},[491,1906,1907],{"class":501},"))",[491,1909,1910],{"class":1017}," \u002F\u002F required, or Define panics\n",[454,1912,1913,1914,1916,1917,1919,1920,1923,1924,1927,1928,468,1931,1934,1935,1938,1939,468,1941,468,1944,468,1946,1949,1950,1952],{},"That panic-at-init behavior exists because a ",[458,1915,1677],{}," without a valid status is a contract nobody can safely render, and the failure mode should be caught the moment the binary starts, not on the first request that happens to exercise it. A ",[458,1918,1677],{},"'s value ",[701,1921,1922],{},"is"," the sentinel: ",[458,1925,1926],{},"errors.Is(err, ErrOutOfStock)"," works directly against it, because every error ",[458,1929,1930],{},".New",[458,1932,1933],{},".Wrap"," produces from it carries a custom ",[458,1936,1937],{},"Is"," matching the definition. ",[458,1940,1930],{},[458,1942,1943],{},".Newf",[458,1945,1933],{},[458,1947,1948],{},".Wrapf"," mirror the package-level constructors, pre-seeded with the definition's code, public message and status, so every occurrence of ",[458,1951,1116],{}," in the codebase renders identically without repeating those three attributes at every call site.",[511,1954,1956],{"id":1955},"standalone-example","Standalone example",[482,1958,1961],{"className":484,"code":1959,"filename":1960,"language":486,"meta":487,"style":487},"package main\n\nimport (\n    \"errors\"\n    \"fmt\"\n    \"net\u002Fhttp\"\n\n    \"github.com\u002Fgp-system\u002Ferrs\"\n)\n\nvar ErrNotFound = errs.Define(\"not_found\",\n    errs.Public(\"The requested item does not exist.\"),\n    errs.Status(http.StatusNotFound))\n\nfunc lookup(id string) (string, error) {\n    if id != \"known\" {\n        return \"\", ErrNotFound.New(\"lookup\", errs.With(\"id\", id))\n    }\n    return \"value\", nil\n}\n\nfunc main() {\n    _, err := lookup(\"missing\")\n\n    fmt.Println(errors.Is(err, ErrNotFound)) \u002F\u002F true\n    fmt.Println(errs.CodeOf(err))            \u002F\u002F \"not_found\"\n    fmt.Println(errs.StatusOf(err))          \u002F\u002F 404\n    fmt.Println(errs.PublicOf(err))          \u002F\u002F \"The requested item does not exist.\"\n\n    for _, step := range errs.Chain(err) {\n        fmt.Printf(\"%s (%s:%d)\\n\", step.Msg, step.File, step.Line)\n    }\n}\n","main.go",[458,1962,1963,1971,1975,1982,1992,2001,2010,2014,2022,2026,2030,2056,2075,2094,2098,2126,2145,2194,2199,2216,2221,2226,2239,2264,2269,2301,2328,2354,2381,2386,2419,2483,2488],{"__ignoreMap":487},[491,1964,1965,1968],{"class":493,"line":494},[491,1966,1967],{"class":501},"package",[491,1969,1970],{"class":505}," main\n",[491,1972,1973],{"class":493,"line":563},[491,1974,885],{"emptyLinePlaceholder":884},[491,1976,1977,1979],{"class":493,"line":594},[491,1978,498],{"class":497},[491,1980,1981],{"class":501}," (\n",[491,1983,1984,1987,1990],{"class":493,"line":631},[491,1985,1986],{"class":501},"    \"",[491,1988,1989],{"class":505},"errors",[491,1991,509],{"class":501},[491,1993,1994,1996,1999],{"class":493,"line":666},[491,1995,1986],{"class":501},[491,1997,1998],{"class":505},"fmt",[491,2000,509],{"class":501},[491,2002,2003,2005,2008],{"class":493,"line":914},[491,2004,1986],{"class":501},[491,2006,2007],{"class":505},"net\u002Fhttp",[491,2009,509],{"class":501},[491,2011,2012],{"class":493,"line":957},[491,2013,885],{"emptyLinePlaceholder":884},[491,2015,2016,2018,2020],{"class":493,"line":1385},[491,2017,1986],{"class":501},[491,2019,506],{"class":505},[491,2021,509],{"class":501},[491,2023,2024],{"class":493,"line":1393},[491,2025,954],{"class":501},[491,2027,2028],{"class":493,"line":1400},[491,2029,885],{"emptyLinePlaceholder":884},[491,2031,2032,2034,2037,2039,2041,2043,2045,2047,2049,2052,2054],{"class":493,"line":1407},[491,2033,1097],{"class":501},[491,2035,2036],{"class":781}," ErrNotFound ",[491,2038,1103],{"class":501},[491,2040,825],{"class":781},[491,2042,743],{"class":501},[491,2044,463],{"class":527},[491,2046,531],{"class":501},[491,2048,844],{"class":501},[491,2050,2051],{"class":840},"not_found",[491,2053,844],{"class":501},[491,2055,1121],{"class":501},[491,2057,2058,2060,2062,2064,2066,2068,2071,2073],{"class":493,"line":1414},[491,2059,1126],{"class":781},[491,2061,743],{"class":501},[491,2063,1131],{"class":527},[491,2065,531],{"class":501},[491,2067,844],{"class":501},[491,2069,2070],{"class":840},"The requested item does not exist.",[491,2072,844],{"class":501},[491,2074,1143],{"class":501},[491,2076,2077,2079,2081,2083,2085,2087,2089,2092],{"class":493,"line":1422},[491,2078,1126],{"class":781},[491,2080,743],{"class":501},[491,2082,1152],{"class":527},[491,2084,531],{"class":501},[491,2086,1157],{"class":781},[491,2088,743],{"class":501},[491,2090,2091],{"class":781},"StatusNotFound",[491,2093,874],{"class":501},[491,2095,2096],{"class":493,"line":1440},[491,2097,885],{"emptyLinePlaceholder":884},[491,2099,2100,2102,2105,2107,2110,2112,2114,2116,2118,2120,2122,2124],{"class":493,"line":1445},[491,2101,524],{"class":501},[491,2103,2104],{"class":527}," lookup",[491,2106,531],{"class":501},[491,2108,2109],{"class":534},"id",[491,2111,539],{"class":538},[491,2113,554],{"class":501},[491,2115,1668],{"class":501},[491,2117,1431],{"class":538},[491,2119,542],{"class":501},[491,2121,607],{"class":538},[491,2123,554],{"class":501},[491,2125,817],{"class":501},[491,2127,2128,2131,2134,2136,2138,2141,2143],{"class":493,"line":1450},[491,2129,2130],{"class":497},"    if",[491,2132,2133],{"class":781}," id ",[491,2135,811],{"class":501},[491,2137,502],{"class":501},[491,2139,2140],{"class":840},"known",[491,2142,844],{"class":501},[491,2144,817],{"class":501},[491,2146,2147,2150,2153,2155,2158,2160,2162,2164,2166,2169,2171,2173,2175,2177,2179,2181,2183,2185,2187,2189,2192],{"class":493,"line":1475},[491,2148,2149],{"class":497},"        return",[491,2151,2152],{"class":501}," \"\"",[491,2154,542],{"class":501},[491,2156,2157],{"class":781}," ErrNotFound",[491,2159,743],{"class":501},[491,2161,705],{"class":527},[491,2163,531],{"class":501},[491,2165,844],{"class":501},[491,2167,2168],{"class":840},"lookup",[491,2170,844],{"class":501},[491,2172,542],{"class":501},[491,2174,825],{"class":781},[491,2176,743],{"class":501},[491,2178,853],{"class":527},[491,2180,531],{"class":501},[491,2182,844],{"class":501},[491,2184,2109],{"class":840},[491,2186,844],{"class":501},[491,2188,542],{"class":501},[491,2190,2191],{"class":781}," id",[491,2193,874],{"class":501},[491,2195,2196],{"class":493,"line":1498},[491,2197,2198],{"class":501},"    }\n",[491,2200,2202,2204,2206,2209,2211,2213],{"class":493,"line":2201},19,[491,2203,822],{"class":497},[491,2205,502],{"class":501},[491,2207,2208],{"class":840},"value",[491,2210,844],{"class":501},[491,2212,542],{"class":501},[491,2214,2215],{"class":501}," nil\n",[491,2217,2219],{"class":493,"line":2218},20,[491,2220,879],{"class":501},[491,2222,2224],{"class":493,"line":2223},21,[491,2225,885],{"emptyLinePlaceholder":884},[491,2227,2229,2231,2234,2237],{"class":493,"line":2228},22,[491,2230,524],{"class":501},[491,2232,2233],{"class":527}," main",[491,2235,2236],{"class":501},"()",[491,2238,817],{"class":501},[491,2240,2242,2245,2247,2249,2251,2253,2255,2257,2260,2262],{"class":493,"line":2241},23,[491,2243,2244],{"class":781},"    _",[491,2246,542],{"class":501},[491,2248,782],{"class":781},[491,2250,785],{"class":501},[491,2252,2104],{"class":527},[491,2254,531],{"class":501},[491,2256,844],{"class":501},[491,2258,2259],{"class":840},"missing",[491,2261,844],{"class":501},[491,2263,954],{"class":501},[491,2265,2267],{"class":493,"line":2266},24,[491,2268,885],{"emptyLinePlaceholder":884},[491,2270,2272,2275,2277,2280,2282,2284,2286,2288,2290,2292,2294,2296,2298],{"class":493,"line":2271},25,[491,2273,2274],{"class":781},"    fmt",[491,2276,743],{"class":501},[491,2278,2279],{"class":527},"Println",[491,2281,531],{"class":501},[491,2283,1989],{"class":781},[491,2285,743],{"class":501},[491,2287,1937],{"class":527},[491,2289,531],{"class":501},[491,2291,604],{"class":781},[491,2293,542],{"class":501},[491,2295,2157],{"class":781},[491,2297,1907],{"class":501},[491,2299,2300],{"class":1017}," \u002F\u002F true\n",[491,2302,2304,2306,2308,2310,2312,2314,2316,2319,2321,2323,2325],{"class":493,"line":2303},26,[491,2305,2274],{"class":781},[491,2307,743],{"class":501},[491,2309,2279],{"class":527},[491,2311,531],{"class":501},[491,2313,272],{"class":781},[491,2315,743],{"class":501},[491,2317,2318],{"class":527},"CodeOf",[491,2320,531],{"class":501},[491,2322,604],{"class":781},[491,2324,1907],{"class":501},[491,2326,2327],{"class":1017},"            \u002F\u002F \"not_found\"\n",[491,2329,2331,2333,2335,2337,2339,2341,2343,2345,2347,2349,2351],{"class":493,"line":2330},27,[491,2332,2274],{"class":781},[491,2334,743],{"class":501},[491,2336,2279],{"class":527},[491,2338,531],{"class":501},[491,2340,272],{"class":781},[491,2342,743],{"class":501},[491,2344,1314],{"class":527},[491,2346,531],{"class":501},[491,2348,604],{"class":781},[491,2350,1907],{"class":501},[491,2352,2353],{"class":1017},"          \u002F\u002F 404\n",[491,2355,2357,2359,2361,2363,2365,2367,2369,2372,2374,2376,2378],{"class":493,"line":2356},28,[491,2358,2274],{"class":781},[491,2360,743],{"class":501},[491,2362,2279],{"class":527},[491,2364,531],{"class":501},[491,2366,272],{"class":781},[491,2368,743],{"class":501},[491,2370,2371],{"class":527},"PublicOf",[491,2373,531],{"class":501},[491,2375,604],{"class":781},[491,2377,1907],{"class":501},[491,2379,2380],{"class":1017},"          \u002F\u002F \"The requested item does not exist.\"\n",[491,2382,2384],{"class":493,"line":2383},29,[491,2385,885],{"emptyLinePlaceholder":884},[491,2387,2389,2392,2395,2397,2400,2402,2405,2407,2409,2411,2413,2415,2417],{"class":493,"line":2388},30,[491,2390,2391],{"class":497},"    for",[491,2393,2394],{"class":781}," _",[491,2396,542],{"class":501},[491,2398,2399],{"class":781}," step ",[491,2401,785],{"class":501},[491,2403,2404],{"class":497}," range",[491,2406,825],{"class":781},[491,2408,743],{"class":501},[491,2410,1540],{"class":527},[491,2412,531],{"class":501},[491,2414,604],{"class":781},[491,2416,554],{"class":501},[491,2418,817],{"class":501},[491,2420,2422,2425,2427,2430,2432,2434,2437,2439,2441,2444,2446,2448,2451,2453,2455,2458,2460,2463,2465,2467,2469,2472,2474,2476,2478,2481],{"class":493,"line":2421},31,[491,2423,2424],{"class":781},"        fmt",[491,2426,743],{"class":501},[491,2428,2429],{"class":527},"Printf",[491,2431,531],{"class":501},[491,2433,844],{"class":501},[491,2435,2436],{"class":932},"%s",[491,2438,1668],{"class":840},[491,2440,2436],{"class":932},[491,2442,2443],{"class":840},":",[491,2445,933],{"class":932},[491,2447,554],{"class":840},[491,2449,2450],{"class":781},"\\n",[491,2452,844],{"class":501},[491,2454,542],{"class":501},[491,2456,2457],{"class":781}," step",[491,2459,743],{"class":501},[491,2461,2462],{"class":781},"Msg",[491,2464,542],{"class":501},[491,2466,2457],{"class":781},[491,2468,743],{"class":501},[491,2470,2471],{"class":781},"File",[491,2473,542],{"class":501},[491,2475,2457],{"class":781},[491,2477,743],{"class":501},[491,2479,2480],{"class":781},"Line",[491,2482,954],{"class":501},[491,2484,2486],{"class":493,"line":2485},32,[491,2487,2198],{"class":501},[491,2489,2491],{"class":493,"line":2490},33,[491,2492,879],{"class":501},[511,2494,2496],{"id":2495},"related-pages","Related pages",[695,2498,2499,2505,2518,2523],{},[698,2500,2501,2504],{},[478,2502,2503],{"href":277},"errs: Overview",": install, the two-message design.",[698,2506,2507,936,2510,2513,2514,2517],{},[478,2508,2509],{"href":285},"errs: Integration",[458,2511,2512],{},"LogValue",", Sentry's ",[458,2515,2516],{},"StackTrace()",", and a minimal HTTP mapper.",[698,2519,2520,2522],{},[478,2521,185],{"href":186},": the full request-to-response pipeline this API feeds.",[698,2524,2525,2528,2529,2531],{},[478,2526,2527],{"href":314},"httperr: Overview",": rendering ",[458,2530,272],{}," errors to RFC 9457 responses.",[2533,2534,2535],"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 .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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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":487,"searchDepth":563,"depth":563,"links":2537},[2538,2539,2540,2541,2542,2543,2544,2545],{"id":513,"depth":563,"text":514},{"id":962,"depth":563,"text":963},{"id":1240,"depth":563,"text":1241},{"id":1322,"depth":563,"text":1323},{"id":1565,"depth":563,"text":1566},{"id":1601,"depth":563,"text":1602},{"id":1955,"depth":563,"text":1956},{"id":2495,"depth":563,"text":2496},"The errs package API: New, Wrap, Define, attributes and accessors.","md",null,{},{"icon":188},{"title":280,"description":2546},"-J0Ps0TE33pWJTf1DVu_CZMjsFFiRZNLwY_s87AZWbc",[2554,2556],{"title":52,"path":277,"stem":278,"description":2555,"icon":188,"children":-1},"Structured Go errors with stacks, codes and client-safe messages.",{"title":284,"path":285,"stem":286,"description":2557,"icon":188,"children":-1},"Wiring errs into logging, Sentry and plain net\u002Fhttp handlers.",1787346809638]