File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33All notable changes to this project are documented in this file.
44
5+ ## [ v0.8.1] - 2026-01-07
6+
7+ ### fix
8+
9+ - ** Validation** : Fixed crash in Zod error formatting middleware
10+ - Added defensive null check in ` formatZodErrors ` function
11+ - Handle cases where ` error.errors ` is undefined by falling back to ` error.issues `
12+ - Added safe property access with optional chaining to prevent unhandled rejections
13+ - Prevents server crash when validation errors have unexpected structure
14+
515## [ v0.8.0] - 2026-01-03
616
717### feat
Original file line number Diff line number Diff line change @@ -15,10 +15,19 @@ const formatZodErrors = (error) => {
1515 return { message : 'Validation error' , errors : [ ] } ;
1616 }
1717
18- const errors = error . errors . map ( err => ( {
19- field : err . path . join ( '.' ) ,
20- message : err . message ,
21- code : err . code ,
18+ // Defensive check for error.errors being undefined or not an array
19+ const zodErrors = error . errors || error . issues || [ ] ;
20+ if ( ! Array . isArray ( zodErrors ) ) {
21+ return {
22+ message : error . message || 'Validation failed' ,
23+ errors : [ ]
24+ } ;
25+ }
26+
27+ const errors = zodErrors . map ( err => ( {
28+ field : err . path ?. join ( '.' ) || '' ,
29+ message : err . message || 'Invalid value' ,
30+ code : err . code || 'validation_error' ,
2231 } ) ) ;
2332
2433 // Create a summary message from the first few errors
Original file line number Diff line number Diff line change 11{
22 "name" : " finx" ,
3- "version" : " 0.8.0 " ,
3+ "version" : " 0.8.1 " ,
44 "description" : " A modern personal finance management application" ,
55 "main" : " server.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments