Skip to content

Commit 8795569

Browse files
committed
changelog
1 parent 1a1f3c0 commit 8795569

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

spiceflow/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# spiceflow
22

3+
## 1.13.3
4+
5+
### Patch Changes
6+
7+
- Add path parameter to onError handler and validate error status codes. The onError handler now receives the request path where the error occurred, making it easier to debug and log errors with context. Additionally, error status codes are now validated to ensure they are valid HTTP status codes (100-599), defaulting to 500 for invalid values.
8+
9+
```typescript
10+
// Before
11+
app.onError(({ error, request }) => {
12+
console.log('Error occurred', error)
13+
return new Response('Error', { status: 500 })
14+
})
15+
16+
// After
17+
app.onError(({ error, request, path }) => {
18+
console.log(`Error occurred at ${path}`, error)
19+
return new Response('Error', { status: 500 })
20+
})
21+
```
22+
323
## 1.13.2
424

525
### Patch Changes

spiceflow/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spiceflow",
3-
"version": "1.13.2",
3+
"version": "1.13.3",
44
"description": "Simple API framework with RPC and type safety",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)