@stacksjs/error-handling 0.75.519 → 0.75.522

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.
@@ -64,3 +64,4 @@ declare interface UserContext {
64
64
  export declare interface CodeSnippetResult {
65
65
  lines: Array<{ number: number, content: string, highlight: boolean }>
66
66
  }
67
+ export {};
@@ -1,10 +1,5 @@
1
1
  import { ERROR_PAGE_CSS } from './error-page-styles';
2
2
  export declare function isFrameworkFrame(file: string): boolean;
3
- /**
4
- * The app's name for an error page. Read lazily and never thrown from: the
5
- * page is served when something already went wrong, config loading included.
6
- */
7
- declare function appName(): string;
8
3
  /**
9
4
  * Render the production error page: the status and its message on one side,
10
5
  * the illustration that fits it on the other.
@@ -239,6 +234,12 @@ export type HttpStatusCode = 400 | 401 | 403 | 404 | 405 | 408 | 409 | 410 | 422
239
234
  * Error Page Handler class
240
235
  */
241
236
  export declare class ErrorPageHandler {
237
+ private config;
238
+ private framework;
239
+ private request;
240
+ private routing;
241
+ private user;
242
+ private queries;
242
243
  constructor(config?: ErrorPageConfig);
243
244
  setFramework(name: string, version?: string): this;
244
245
  setRequest(request: Request | RequestContext): this;
@@ -246,6 +247,7 @@ export declare class ErrorPageHandler {
246
247
  setUser(user: UserContext): this;
247
248
  addQuery(query: string, time?: number, connection?: string): this;
248
249
  render(error: Error, status?: number): Promise<string>;
250
+ private renderFallback;
249
251
  handleError(error: Error, status?: number): Promise<Response>;
250
252
  }
251
253
  export { ERROR_PAGE_CSS };
package/dist/handler.d.ts CHANGED
@@ -21,3 +21,4 @@ export declare class ErrorHandler {
21
21
  static writeErrorToFile(err: Error | unknown, context?: ErrorContext): Promise<void>;
22
22
  static writeErrorToConsole(err: string | Error | unknown): void;
23
23
  }
24
+ export {};
package/dist/http.d.ts CHANGED
@@ -26,6 +26,8 @@ export declare function errorMiddleware(options?: {
26
26
  * HTTP error handler with Ignition-style error pages
27
27
  */
28
28
  export declare class HttpErrorHandler {
29
+ private handler;
30
+ private isDevelopment;
29
31
  constructor(options?: {
30
32
  isDevelopment?: boolean
31
33
  config?: ErrorPageConfig
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/error-handling",
3
3
  "type": "module",
4
- "version": "0.75.519",
4
+ "version": "0.75.522",
5
5
  "description": "Type safe error handling.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -58,16 +58,16 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@bughq/sdk": "^0.3.0",
61
- "@stacksjs/config": "0.75.519",
62
- "@stacksjs/path": "0.75.519",
61
+ "@stacksjs/config": "0.75.522",
62
+ "@stacksjs/path": "0.75.522",
63
63
  "@stacksjs/stx": "0.2.807",
64
- "@stacksjs/types": "0.75.519",
64
+ "@stacksjs/types": "0.75.522",
65
65
  "ts-error-handling": "^0.1.3",
66
66
  "ts-syntax-highlighter": "^0.2.17"
67
67
  },
68
68
  "devDependencies": {
69
- "@stacksjs/cli": "0.75.519",
70
- "@stacksjs/validation": "0.75.519",
69
+ "@stacksjs/cli": "0.75.522",
70
+ "@stacksjs/validation": "0.75.522",
71
71
  "better-dx": "^0.2.24"
72
72
  },
73
73
  "sideEffects": false