[{"data":1,"prerenderedAt":627},["ShallowReactive",2],{"docs-nav:en":3,"docs:\u002Fdocs\u002Fbusiness\u002Ferrors":134},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","\u002Fdocs","docs",[9,12,16,20,24,42,63,92,113],{"title":10,"path":6,"stem":11},"What is Fougere","docs\u002Findex",{"title":13,"path":14,"stem":15},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started",{"title":17,"path":18,"stem":19},"Existing Nuxt app","\u002Fdocs\u002Fexisting-app","docs\u002F02.existing-app",{"title":21,"path":22,"stem":23},"The CLI","\u002Fdocs\u002Fcli","docs\u002F03.cli",{"title":25,"path":26,"stem":27,"children":28,"page":41},"Concepts","\u002Fdocs\u002Fconcepts","docs\u002F2.concepts",[29,33,37],{"title":30,"path":31,"stem":32},"Philosophy","\u002Fdocs\u002Fconcepts\u002Fphilosophy","docs\u002F2.concepts\u002F1.philosophy",{"title":34,"path":35,"stem":36},"The Frond","\u002Fdocs\u002Fconcepts\u002Ffrond","docs\u002F2.concepts\u002F2.frond",{"title":38,"path":39,"stem":40},"The shortest path","\u002Fdocs\u002Fconcepts\u002Fshortest-path","docs\u002F2.concepts\u002F3.shortest-path",false,{"title":43,"path":44,"stem":45,"children":46,"page":41},"Schema","\u002Fdocs\u002Fschema","docs\u002F3.schema",[47,51,55,59],{"title":48,"path":49,"stem":50},"Entities","\u002Fdocs\u002Fschema\u002Fentities","docs\u002F3.schema\u002F1.entities",{"title":52,"path":53,"stem":54},"Views","\u002Fdocs\u002Fschema\u002Fviews","docs\u002F3.schema\u002F2.views",{"title":56,"path":57,"stem":58},"The identity card","\u002Fdocs\u002Fschema\u002Fcard","docs\u002F3.schema\u002F3.card",{"title":60,"path":61,"stem":62},"Standard Schema","\u002Fdocs\u002Fschema\u002Fstandard-schema","docs\u002F3.schema\u002F4.standard-schema",{"title":64,"path":65,"stem":66,"children":67,"page":41},"Business","\u002Fdocs\u002Fbusiness","docs\u002F4.business",[68,72,76,80,84,88],{"title":69,"path":70,"stem":71},"Handlers","\u002Fdocs\u002Fbusiness\u002Fhandlers","docs\u002F4.business\u002F1.handlers",{"title":73,"path":74,"stem":75},"Presenters","\u002Fdocs\u002Fbusiness\u002Fpresenters","docs\u002F4.business\u002F2.presenters",{"title":77,"path":78,"stem":79},"Collectors","\u002Fdocs\u002Fbusiness\u002Fcollectors","docs\u002F4.business\u002F3.collectors",{"title":81,"path":82,"stem":83},"Errors","\u002Fdocs\u002Fbusiness\u002Ferrors","docs\u002F4.business\u002F4.errors",{"title":85,"path":86,"stem":87},"Seeds","\u002Fdocs\u002Fbusiness\u002Fseeds","docs\u002F4.business\u002F5.seeds",{"title":89,"path":90,"stem":91},"Facts","\u002Fdocs\u002Fbusiness\u002Ffacts","docs\u002F4.business\u002F6.facts",{"title":93,"path":94,"stem":95,"children":96,"page":41},"Client","\u002Fdocs\u002Fclient","docs\u002F5.client",[97,101,105,109],{"title":98,"path":99,"stem":100},"Queries & commands","\u002Fdocs\u002Fclient\u002Fqueries-commands","docs\u002F5.client\u002F1.queries-commands",{"title":102,"path":103,"stem":104},"Forms","\u002Fdocs\u002Fclient\u002Fforms","docs\u002F5.client\u002F2.forms",{"title":106,"path":107,"stem":108},"Session","\u002Fdocs\u002Fclient\u002Fsession","docs\u002F5.client\u002F3.session",{"title":110,"path":111,"stem":112},"invoke","\u002Fdocs\u002Fclient\u002Finvoke","docs\u002F5.client\u002F4.invoke",{"title":114,"path":115,"stem":116,"children":117,"page":41},"Infrastructure","\u002Fdocs\u002Finfra","docs\u002F6.infra",[118,122,126,130],{"title":119,"path":120,"stem":121},"The gradient","\u002Fdocs\u002Finfra\u002Fgradient","docs\u002F6.infra\u002F1.gradient",{"title":123,"path":124,"stem":125},"Surfaces — REST & GraphQL","\u002Fdocs\u002Finfra\u002Fsurfaces","docs\u002F6.infra\u002F2.surfaces",{"title":127,"path":128,"stem":129},"Deployment","\u002Fdocs\u002Finfra\u002Fdeployment","docs\u002F6.infra\u002F3.deployment",{"title":131,"path":132,"stem":133},"Hosts","\u002Fdocs\u002Finfra\u002Fhosts","docs\u002F6.infra\u002F4.hosts",{"id":135,"title":81,"body":136,"description":621,"extension":622,"meta":623,"navigation":624,"path":82,"seo":625,"stem":83,"__hash__":626},"docs_en\u002Fdocs\u002F4.business\u002F4.errors.md",{"type":137,"value":138,"toc":613},"minimark",[139,143,151,301,306,432,439,445,456,460,538,544,548,551,603,609],[140,141,81],"h1",{"id":142},"errors",[144,145,146,150],"p",{},[147,148,149],"code",{},"FougereError"," represents a domain error with a typed code. Handlers throw it, and the\nfollowing layers retain its code, message, and details.",[152,153,158],"pre",{"className":154,"code":155,"language":156,"meta":157,"style":157},"language-ts shiki shiki-themes material-theme-lighter github-light github-dark","throw new FougereError({\n  code: ErrorCode.CONFLICT,\n  message: `Slug '${slug}' is already taken`,\n  entity: 'post',\n  operation: 'create',\n  \u002F\u002F details?: [{ path, message }]   — per-field, used by VALIDATION_FAILED\n  \u002F\u002F cause?: unknown\n});\n","ts","",[147,159,160,185,208,241,260,277,284,290],{"__ignoreMap":157},[161,162,165,169,173,177,181],"span",{"class":163,"line":164},"line",1,[161,166,168],{"class":167},"sVHd0","throw",[161,170,172],{"class":171},"smGrS"," new",[161,174,176],{"class":175},"sGLFI"," FougereError",[161,178,180],{"class":179},"su5hD","(",[161,182,184],{"class":183},"sP7_E","{\n",[161,186,188,192,195,198,201,205],{"class":163,"line":187},2,[161,189,191],{"class":190},"skxfh","  code",[161,193,194],{"class":183},":",[161,196,197],{"class":179}," ErrorCode",[161,199,200],{"class":183},".",[161,202,204],{"class":203},"s_hVV","CONFLICT",[161,206,207],{"class":183},",\n",[161,209,211,214,216,220,224,227,230,233,236,239],{"class":163,"line":210},3,[161,212,213],{"class":190},"  message",[161,215,194],{"class":183},[161,217,219],{"class":218},"sjJ54"," `",[161,221,223],{"class":222},"s_sjI","Slug '",[161,225,226],{"class":218},"${",[161,228,229],{"class":179},"slug",[161,231,232],{"class":218},"}",[161,234,235],{"class":222},"' is already taken",[161,237,238],{"class":218},"`",[161,240,207],{"class":183},[161,242,244,247,249,252,255,258],{"class":163,"line":243},4,[161,245,246],{"class":190},"  entity",[161,248,194],{"class":183},[161,250,251],{"class":218}," '",[161,253,254],{"class":222},"post",[161,256,257],{"class":218},"'",[161,259,207],{"class":183},[161,261,263,266,268,270,273,275],{"class":163,"line":262},5,[161,264,265],{"class":190},"  operation",[161,267,194],{"class":183},[161,269,251],{"class":218},[161,271,272],{"class":222},"create",[161,274,257],{"class":218},[161,276,207],{"class":183},[161,278,280],{"class":163,"line":279},6,[161,281,283],{"class":282},"sutJx","  \u002F\u002F details?: [{ path, message }]   — per-field, used by VALIDATION_FAILED\n",[161,285,287],{"class":163,"line":286},7,[161,288,289],{"class":282},"  \u002F\u002F cause?: unknown\n",[161,291,293,295,298],{"class":163,"line":292},8,[161,294,232],{"class":183},[161,296,297],{"class":179},")",[161,299,300],{"class":183},";\n",[302,303,305],"h2",{"id":304},"the-codes","The codes",[307,308,309,325],"table",{},[310,311,312],"thead",{},[313,314,315,319,322],"tr",{},[316,317,318],"th",{},"Code",[316,320,321],{},"Meaning",[316,323,324],{},"HTTP projection",[326,327,328,349,362,375,388,406,419],"tbody",{},[313,329,330,336,346],{},[331,332,333],"td",{},[147,334,335],{},"VALIDATION_FAILED",[331,337,338,339,342,343],{},"invalid input — ",[147,340,341],{},"details"," contains per-field ",[147,344,345],{},"{ path, message }",[331,347,348],{},"400",[313,350,351,356,359],{},[331,352,353],{},[147,354,355],{},"UNAUTHORIZED",[331,357,358],{},"no identity",[331,360,361],{},"401",[313,363,364,369,372],{},[331,365,366],{},[147,367,368],{},"FORBIDDEN",[331,370,371],{},"identity present, right absent",[331,373,374],{},"403",[313,376,377,382,385],{},[331,378,379],{},[147,380,381],{},"NOT_FOUND",[331,383,384],{},"designated thing does not exist",[331,386,387],{},"404",[313,389,390,394,403],{},[331,391,392],{},[147,393,204],{},[331,395,396,397,402],{},"state refuses the transition (",[398,399,401],"a",{"href":400},"\u002Fdocs\u002Fbusiness\u002Fhandlers#a-state-changes-through-an-operation-never-through-a-field-write","already published",", slug taken)",[331,404,405],{},"409",[313,407,408,413,416],{},[331,409,410],{},[147,411,412],{},"SERVICE_UNAVAILABLE",[331,414,415],{},"a remote Frond is unreachable",[331,417,418],{},"503",[313,420,421,426,429],{},[331,422,423],{},[147,424,425],{},"INTERNAL_ERROR",[331,427,428],{},"anything unexpected",[331,430,431],{},"500",[433,434,436,438],"h3",{"id":435},"internal_error-is-the-one-code-whose-message-never-leaves",[147,437,425],{}," is the one code whose message never leaves",[144,440,441,442,444],{},"The other six were written for the caller and travel whole. An ",[147,443,425],{}," was not:\nit may quote a path, a query or a row, so it is replaced by a constant before leaving the\nprocess.",[144,446,447,448,452,453,455],{},"It is ",[449,450,451],"strong",{},"logged in the same place"," — masking and recording live in one function, so the\nsentence exists exactly once, on the server. An operator asking \"why this 500\" finds it in\nthe logs with its cause, its entity and its operation; an attacker never sees it. If your\nmessage must reach the caller, then it is not an ",[147,454,425],{},": give it its code.",[302,457,459],{"id":458},"error-propagation","Error propagation",[461,462,463,473,479,497,526],"ol",{},[464,465,466,469,470,472],"li",{},[449,467,468],{},"Handler throws"," ",[147,471,149],{}," — the same object whether the Frond is local or remote.",[464,474,475,478],{},[449,476,477],{},"Local call"," — the error propagates in memory, untouched.",[464,480,481,484,485,207,488,491,492,494,495,200],{},[449,482,483],{},"Remote call"," — the transport frames it as a JSON-RPC error (",[147,486,487],{},"code: -32000",[147,489,490],{},"data: { code, message, entity, operation, details? }",") and the client side\nrebuilds a ",[147,493,149],{},", including its ",[147,496,341],{},[464,498,499,502,503,506,507,510,511,514,515,517,518,521,522,525],{},[449,500,501],{},"In a page"," — ",[147,504,505],{},"useQuery","\u002F",[147,508,509],{},"useCommand"," expose it as ",[147,512,513],{},"error"," (a real ",[147,516,149],{},");\n",[147,519,520],{},"useFormFor"," maps ",[147,523,524],{},"VALIDATION_FAILED.details"," onto per-field errors automatically.",[464,527,528,502,531,534,535,200],{},[449,529,530],{},"On the REST surface",[147,532,533],{},"toHttpError"," projects the code to the real HTTP status\n(table above), the full typed value in ",[147,536,537],{},"data",[144,539,540,541,543],{},"The browser receives the same code, message, and per-field errors whether the Frond is\nlocal or remote. An unreachable host produces a typed ",[147,542,412],{}," error.",[302,545,547],{"id":546},"check-order","Check order",[144,549,550],{},"The site's blog performs checks in this order:",[152,552,554],{"className":154,"code":553,"language":156,"meta":157,"style":157},"requireUser(user)        \u002F\u002F UNAUTHORIZED\n→ requireOwn(id, user)   \u002F\u002F NOT_FOUND, then FORBIDDEN\n→ state checks           \u002F\u002F CONFLICT (already published, empty draft)\n→ realize                \u002F\u002F orm.update(…)\n",[147,555,556,567,587,595],{"__ignoreMap":157},[161,557,558,561,564],{"class":163,"line":164},[161,559,560],{"class":175},"requireUser",[161,562,563],{"class":179},"(user)        ",[161,565,566],{"class":282},"\u002F\u002F UNAUTHORIZED\n",[161,568,569,572,575,578,581,584],{"class":163,"line":187},[161,570,571],{"class":179},"→ ",[161,573,574],{"class":175},"requireOwn",[161,576,577],{"class":179},"(id",[161,579,580],{"class":183},",",[161,582,583],{"class":179}," user)   ",[161,585,586],{"class":282},"\u002F\u002F NOT_FOUND, then FORBIDDEN\n",[161,588,589,592],{"class":163,"line":210},[161,590,591],{"class":179},"→ state checks           ",[161,593,594],{"class":282},"\u002F\u002F CONFLICT (already published, empty draft)\n",[161,596,597,600],{"class":163,"line":243},[161,598,599],{"class":179},"→ realize                ",[161,601,602],{"class":282},"\u002F\u002F orm.update(…)\n",[144,604,605,606,608],{},"Next: ",[398,607,85],{"href":86}," — initializing data through operations.",[610,611,612],"style",{},"html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}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);}",{"title":157,"searchDepth":187,"depth":187,"links":614},[615,619,620],{"id":304,"depth":187,"text":305,"children":616},[617],{"id":435,"depth":210,"text":618},"INTERNAL_ERROR is the one code whose message never leaves",{"id":458,"depth":187,"text":459},{"id":546,"depth":187,"text":547},"FougereError, the available codes, and their transport across surfaces.","md",{},true,{"title":81,"description":621},"SMujkVdLpDPfXc_7bFpzgXVzT6_9L5AyAxF0LbpZvYw",1786637819163]