File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " error-lib" ,
3- "version" : " 2.0.1 " ,
3+ "version" : " 2.0.2 " ,
44 "description" : " Standard Error Library for JavaScript/TypeScript projects (NodeJS & Browsers)" ,
55 "type" : " commonjs" ,
66 "files" : [
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ export * from './forbidden_error';
44export * from './not_found_error' ;
55export * from './resource_not_found_error' ;
66export * from './route_not_found_error' ;
7+ export * from './serializer' ;
78export * from './validation_error' ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Normalize error object to remove non-serializable properties
3+ * @param error Error object
4+ * @returns Normalized error object
5+ */
6+ export const normalizeErrorObject = ( error : Error ) : Error =>
7+ JSON . parse ( JSON . stringify ( error , Object . getOwnPropertyNames ( error ) ) ) ;
You can’t perform that action at this time.
0 commit comments