@ooneex/exception 0.0.18 → 1.0.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/README.md +7 -25
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,51 +1,33 @@
|
|
|
1
1
|
# @ooneex/exception
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Structured exception handling with HTTP status code mapping, typed error data, and JSON-formatted stack traces for consistent error reporting. This package provides a base `Exception` class and specialized exception types for common HTTP error scenarios with rich metadata including timestamps, status codes, and structured stack traces.
|
|
4
4
|
|
|
5
5
|

|
|
6
|
-

|
|
7
|
-

|
|
8
6
|

|
|
9
7
|

|
|
10
8
|
|
|
11
9
|
## Features
|
|
12
10
|
|
|
13
|
-
✅ **HTTP Status
|
|
11
|
+
✅ **HTTP Status Mapping** - Built-in support for all HTTP status codes via `@ooneex/http-status`
|
|
14
12
|
|
|
15
|
-
✅ **
|
|
13
|
+
✅ **JSON Stack Traces** - Parse stack traces into structured JSON arrays for logging and debugging
|
|
16
14
|
|
|
17
|
-
✅ **
|
|
15
|
+
✅ **Typed Error Data** - Include timestamps, custom data, and original errors with read-only access
|
|
18
16
|
|
|
19
|
-
✅ **Specialized Exceptions** - Pre-built
|
|
17
|
+
✅ **Specialized Exceptions** - Pre-built `BadRequestException`, `NotFoundException`, `UnauthorizedException`, and `MethodNotAllowedException`
|
|
20
18
|
|
|
21
|
-
✅ **Type-Safe** - Full TypeScript support with
|
|
19
|
+
✅ **Type-Safe** - Full TypeScript support with `IException` interface and `ExceptionStackFrameType`
|
|
22
20
|
|
|
23
21
|
✅ **Immutable Data** - Exception data is frozen after creation
|
|
24
22
|
|
|
25
|
-
✅ **Native Error Wrapping** - Wrap native JavaScript errors while preserving context
|
|
23
|
+
✅ **Native Error Wrapping** - Wrap native JavaScript errors while preserving context and stack traces
|
|
26
24
|
|
|
27
25
|
## Installation
|
|
28
26
|
|
|
29
|
-
### Bun
|
|
30
27
|
```bash
|
|
31
28
|
bun add @ooneex/exception
|
|
32
29
|
```
|
|
33
30
|
|
|
34
|
-
### pnpm
|
|
35
|
-
```bash
|
|
36
|
-
pnpm add @ooneex/exception
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Yarn
|
|
40
|
-
```bash
|
|
41
|
-
yarn add @ooneex/exception
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### npm
|
|
45
|
-
```bash
|
|
46
|
-
npm install @ooneex/exception
|
|
47
|
-
```
|
|
48
|
-
|
|
49
31
|
## Usage
|
|
50
32
|
|
|
51
33
|
### Basic Exception
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/exception",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.0
|
|
3
|
+
"description": "Structured exception handling with HTTP status code mapping, typed error data, and JSON-formatted stack traces for consistent error reporting",
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"npm:publish": "bun publish --tolerate-republish --access public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ooneex/http-status": "0.0.
|
|
31
|
+
"@ooneex/http-status": "0.0.18"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {},
|
|
34
34
|
"keywords": [
|