{"repo":"ehmicky/normalize-exception","free":true,"listed":false,"github":"https://github.com/ehmicky/normalize-exception","clone":"git clone https://github.com/ehmicky/normalize-exception.git","description":"Normalize exceptions/errors","language":"JavaScript","stars":15,"topics":["browser","cause","code-quality","error","error-handler","error-handling","error-monitoring","error-reporting","errors","exceptions"],"license":"MIT","category":"dev-tools","readme_excerpt":"Normalize: - Exceptions that are not Error instances - Error properties ( name , message , stack , constructor ) that are missing, invalid, enumerable, readonly, non-writable, non-configurable, non-extensible, proxied or throwing - error.cause and error.errors recursively, when present Example Install This package works in both Node.js =18.18.0 and browsers. This is an ES module. It must be loaded using an import or import() statement, not require() . If TypeScript is used, it must be configured to output ES modules, not CommonJS. API normalizeException(error, options?) error any \\ options Options \\ Return value : Error normalizeException() never throws. If error is an Error instance, it is returned. Any missing or invalid error property is directly modified. If it is not an Error instance, a new one is created and returned. Options Options are an optional object with the following properties. shallow Type : boolean \\ Default : false Unless true , error.cause and error.errors are normalized recursively, when present. Features Invalid type Strings Plain objects Others Missing properties Mismatched constructor Missing stack Invalid properties Enumerable properties Readonly properties Non-writable properties Non-configurable properties Non-extensible error Proxies Throwing properties Proxies Getters Recursion error.cause error.errors Related projects - modern-errors : Handle errors in a simple, stable, consistent way - error-custom-class : Create one error class - error-class-ut","default_branch":null,"files":null,"tree":[],"storefront":"/r/ehmicky","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ehmicky/normalize-exception/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}