@stacksjs/error-handling 0.70.34 → 0.70.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -158,7 +158,7 @@ Context: ${JSON.stringify(i,null,2)}`;H(u).catch((d)=>{console.error("Failed to
|
|
|
158
158
|
<a href="/" class="production-link">← Back to Home</a>
|
|
159
159
|
</div>
|
|
160
160
|
</body>
|
|
161
|
-
</html>`}function o(f){let n=G[f];if(!n)return"";let l=Array.isArray(n.commonCauses)&&n.commonCauses.length>0,i=typeof n.suggestion==="string"&&n.suggestion.length>0,v=typeof n.docLink==="string"&&n.docLink.length>0;if(!l&&!i&&!v)return"";let u=l?`<ul class="error-hint-causes">${n.commonCauses.map((C)=>`<li>${c(C)}</li>`).join("")}</ul>`:"",A=i?`<p class="error-hint-suggestion">${c(n.suggestion)}</p>`:"",d=v?`<a class="error-hint-doc" href="${c(n.docLink)}" target="_blank" rel="noreferrer noopener">Read the docs →</a>`:"";return`<section class="error-hint
|
|
161
|
+
</html>`}function o(f){let n=G[f];if(!n)return"";let l=Array.isArray(n.commonCauses)&&n.commonCauses.length>0,i=typeof n.suggestion==="string"&&n.suggestion.length>0,v=typeof n.docLink==="string"&&n.docLink.length>0;if(!l&&!i&&!v)return"";let u=l?`<ul class="error-hint-causes">${n.commonCauses.map((C)=>`<li>${c(C)}</li>`).join("")}</ul>`:"",A=i?`<p class="error-hint-suggestion">${c(n.suggestion)}</p>`:"",d=v?`<a class="error-hint-doc" href="${c(n.docLink)}" target="_blank" rel="noreferrer noopener">Read the docs →</a>`:"";return`<section class="card error-hint">
|
|
162
162
|
<div class="card-header">Likely causes & next steps</div>
|
|
163
163
|
<div class="card-body">${u}${A}${d}</div>
|
|
164
164
|
</section>`}class W{config;framework;request;routing;user;queries=[];constructor(f){this.config={appName:"App",theme:"auto",showEnvironment:!0,showQueries:!0,showRequest:!0,enableCopyMarkdown:!0,snippetLines:8,...f}}setFramework(f,n){return this.framework={name:f,version:n},this}setRequest(f){if(f instanceof Request){let n=new URL(f.url);this.request={method:f.method,url:f.url,headers:Object.fromEntries(f.headers.entries()),queryParams:Object.fromEntries(n.searchParams.entries())}}else this.request=f;return this}setRouting(f){return this.routing=f,this}setUser(f){return this.user=f,this}addQuery(f,n,l){return this.queries.push({query:f,time:n,connection:l}),this}render(f,n=500){let l=K(f.stack,this.config.basePaths,{includeFrameworkFrames:this.config.showFrameworkFrames===!0});return`<!DOCTYPE html>
|