@stacksjs/error-handling 0.65.0 → 0.66.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/error-handling",
3
3
  "type": "module",
4
- "version": "0.65.0",
4
+ "version": "0.66.0",
5
5
  "description": "Type safe error handling.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -35,12 +35,12 @@
35
35
  "prepublishOnly": "bun run build"
36
36
  },
37
37
  "devDependencies": {
38
- "@stacksjs/cli": "0.64.6",
39
- "@stacksjs/config": "0.64.6",
40
- "@stacksjs/development": "0.64.6",
41
- "@stacksjs/path": "0.64.6",
42
- "@stacksjs/types": "0.64.6",
43
- "@stacksjs/validation": "0.64.6",
38
+ "@stacksjs/cli": "0.65.1",
39
+ "@stacksjs/config": "0.65.1",
40
+ "@stacksjs/development": "0.65.1",
41
+ "@stacksjs/path": "0.65.1",
42
+ "@stacksjs/types": "0.65.1",
43
+ "@stacksjs/validation": "0.65.1",
44
44
  "neverthrow": "^8.0.0"
45
45
  }
46
46
  }
package/src/http.ts ADDED
@@ -0,0 +1,6 @@
1
+ export class HttpError extends Error {
2
+ constructor(public status: number, message: string) {
3
+ super(message)
4
+ this.name = 'Server Error!'
5
+ }
6
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './handler'
2
+ export * from './http'
2
3
  export * from './utils'
3
4
  export {
4
5
  err,
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Server Error</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background-color: #f4f4f4;
11
+ margin: 0;
12
+ padding: 20px;
13
+ }
14
+ .error-container {
15
+ background-color: #ffefef;
16
+ border: 1px solid #ff4d4d;
17
+ color: #d8000c;
18
+ padding: 20px;
19
+ border-radius: 5px;
20
+ }
21
+ .error-title {
22
+ font-size: 24px;
23
+ font-weight: bold;
24
+ margin-bottom: 10px;
25
+ }
26
+ .error-message {
27
+ font-size: 18px;
28
+ }
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <div class="error-container">
33
+ <div class="error-title">An Error Occurred</div>
34
+ <p class="error-message">{{ERROR_MESSAGE}}</p>
35
+ </div>
36
+ </body>
37
+ </html>