@erangamadhushan/express-advanced-error-kit 1.4.1 → 1.5.1
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 +9 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ app.use(express.json());
|
|
|
45
45
|
app.get(
|
|
46
46
|
"/error",
|
|
47
47
|
asyncHandler(async () => {
|
|
48
|
-
throw new ApiError("Something went wrong"
|
|
48
|
+
throw new ApiError(400, "Something went wrong");
|
|
49
49
|
}),
|
|
50
50
|
);
|
|
51
51
|
|
|
@@ -127,6 +127,7 @@ throw new ApiError(404, "User not found");
|
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
Also You can extend it:
|
|
130
|
+
|
|
130
131
|
```ts
|
|
131
132
|
class ValidationError extends ApiError {
|
|
132
133
|
constructor(message: string) {
|
|
@@ -136,6 +137,7 @@ class ValidationError extends ApiError {
|
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
# ⚙️ Configuration Options
|
|
140
|
+
|
|
139
141
|
```ts
|
|
140
142
|
errorMiddleware({
|
|
141
143
|
logger?: (error: any) => void;
|
|
@@ -149,3 +151,9 @@ errorMiddleware({
|
|
|
149
151
|
- Clean JSON response format
|
|
150
152
|
- Centralized error control
|
|
151
153
|
|
|
154
|
+
🔄 Automated Releases
|
|
155
|
+
|
|
156
|
+
- Conventional commits
|
|
157
|
+
- semantic-release
|
|
158
|
+
- GitHub Actions CI
|
|
159
|
+
- Automatic versioning and changelog generation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erangamadhushan/express-advanced-error-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Advanced TypeScript error handling middleware for Express applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"dotenv": "^17.3.1",
|
|
54
55
|
"zod": "^4.3.6"
|
|
55
56
|
}
|
|
56
57
|
}
|