{"id":13847405,"url":"https://github.com/borisdiakur/rerror","last_synced_at":"2026-02-20T16:31:59.117Z","repository":{"id":12554102,"uuid":"72228657","full_name":"borisdiakur/rerror","owner":"borisdiakur","description":"Use RError instead of Error in Node.js and the browser. It provides nested information about the cause of failure without significant impact on performance.","archived":false,"fork":false,"pushed_at":"2024-09-24T22:41:00.000Z","size":900,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-23T17:12:57.405Z","etag":null,"topics":["error-handling","stacktrace"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borisdiakur.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-10-28T17:37:40.000Z","updated_at":"2024-06-20T08:53:19.000Z","dependencies_parsed_at":"2023-01-13T17:01:03.414Z","dependency_job_id":"089566cc-528a-4911-8ca1-10ac1a1dc7e0","html_url":"https://github.com/borisdiakur/rerror","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":0.6382978723404256,"last_synced_commit":"aa2bcca06dcbea55a0e52c41121e1f24ef740b4f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/borisdiakur/rerror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdiakur%2Frerror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdiakur%2Frerror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdiakur%2Frerror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdiakur%2Frerror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borisdiakur","download_url":"https://codeload.github.com/borisdiakur/rerror/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdiakur%2Frerror/sbom","scorecard":{"id":248394,"data":{"date":"2025-08-11","repo":{"name":"github.com/borisdiakur/rerror","commit":"4fdf8d4ec543b70ba1748473237328b2db27b6fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci-cd.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-cd.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/borisdiakur/rerror/ci-cd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-cd.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/borisdiakur/rerror/ci-cd.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T08:00:17.497Z","repository_id":12554102,"created_at":"2025-08-17T08:00:17.497Z","updated_at":"2025-08-17T08:00:17.497Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-handling","stacktrace"],"created_at":"2024-08-04T18:01:19.202Z","updated_at":"2026-02-20T16:31:59.100Z","avatar_url":"https://github.com/borisdiakur.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# (ノಠ益ಠ)ノﾐ ɹoɹɹǝɹ\n\n\u003e 🚨 `Error.prototype.cause` has been implemented in [ES2022](https://exploringjs.com/impatient-js/ch_exception-handling.html#error.cause). Consider using the native implementation.\n\n[![Build Status](https://travis-ci.org/borisdiakur/rerror.svg?branch=master)](https://travis-ci.org/borisdiakur/rerror)\n[![Coverage Status](https://coveralls.io/repos/borisdiakur/rerror/badge.svg?branch=master)](https://coveralls.io/r/borisdiakur/rerror?branch=master)\n[![npm version](https://badge.fury.io/js/rerror.svg)](http://badge.fury.io/js/rerror)\n\nUse `RError` instead of `Error` in Node.js and the browser.\nIt provides nested information about the cause of failure\nwithout significant impact on performance.\n\n## Installation\n\n```shell\n$ npm install --save rerror\n```\n\n```shell\n$ yarn add rerror\n```\n\n## Usage\n\nrerror is available in multiple module formats, so that you can import or require it or add it as a script to your html. Here are a few examples:\n\n```js\nimport RError from 'rerror'\nthrow new RError('(×﹏×)')\n```\n\n```js\nconst RError = require('rerror')\nthrow new RError('ヽ(`⌒´メ)ノ')\n```\n\n```html\n\u003cscript src=\"https://unpkg.com/rerror/dist/index.iife.js\"\u003e\u003c/script\u003e\n\u003c!-- RError is now available in the global scope --\u003e\n\u003cscript\u003ethrow new RError('ヾ( ￣O￣)ツ')\u003c/script\u003e\n```\n\nHere is an example illustrating how you can use rerror to pass along the information about the cause of failure:\n\n```js\nfunction fail() {\n  throw new RError({\n    name: 'BAR',\n    message: 'I messed up.'\n  })\n  // Note that you could throw an Error instance here as well,\n  // or have something else throw for you, e.g. JSON.parse('(⇀‸↼‶)')\n}\n\nfunction failFurther() {\n  try {\n    fail()\n  } catch (err) {\n    throw new RError({\n      name: 'FOO',\n      message: 'Something went wrong.',\n      cause: err\n    })\n  }\n}\n\ntry {\n  failFurther()\n} catch (err) {\n  console.error(err.why)\n  console.error(err.stacks)\n}\n```\n\nThe output looks something like this:\n\n```\nFOO: Something went wrong. \u003c- BAR: I messed up.\nError\n    at failFurther (\u003ccurrent_working_dir\u003e/index.js:98:11)\n    at Object.\u003canonymous\u003e (\u003ccurrent_working_dir\u003e/index.js:107:3)\n    ...\n\u003c- Error\n    at fail (\u003ccurrent_working_dir\u003e/index.js:88:9)\n    at failFurther (\u003ccurrent_working_dir\u003e/index.js:96:5)\n    at Object.\u003canonymous\u003e (\u003ccurrent_working_dir\u003e/index.js:107:3)\n    ...\n```\n\n## API\n\nrerror includes a typescript declaration (.d.ts) file, so your editor will probably give you some good hints on how to use it.\n\n### RError\n\n#### new RError(options)\nInstanciates a RError instance.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| options / name | `object` or `string` | Required; if object, it must consist of the following properties:\u003cbr\u003e - `{String} name`\u003cbr\u003e - `{String} [message]`\u003cbr\u003e - `{RError`\u0026#124;`Error} [cause]` |\n\n**Example with cause**  \n```js\nPromise.reject(new Error('fail')).catch(err =\u003e {\n  throw new RError({\n     name: 'BAR',\n     message: 'I messed up',\n     cause: err\n  })\n})\n```\n\n**Example of usage as a drop-in replacement**  \n```js\nthrow new RError('BAR')\n```\n\n### Methods\n\n#### hasCause(name) ⇒ `boolean`\nChecks if a certain cause is in the cause chain of the error.\n\n| Param | Type | Description |\n| --- | --- | --- |\n| name | `string` | The cause name to be searched for in the cause chain |\n\n#### toJSON() ⇒ `Object`\nThe value returned by the toJSON method will be used for serialization when using JSON.stringify.\n\n**Returns:** `{ name: string, message: string, why: string, stacks: string }`\n\n#### toString() ⇒ `String`\nReturns a string representing the specified RError object.\n\n### Properties\n\n#### name: `string`\nThe name property represents a name for the type of error.\n\n#### message: `string`\nThe message property is a human-readable description of the error.\n\n#### [cause] : `RError | Error`\nThe cause error.\n\n#### chain : `(RError | Error)[]`\nThe cause chain of the error.\n\n#### stack : `string`\nGetter returning the stack of the top most error in the chain.\n\n#### stacks : `string`\nGetter returning a stack of stacks using the cause chain.\n\n#### why : `string`\nGetter returning a human readable cause chain, e.g. FOO: I failed \u003c- BAR: I messed up.\n\n___\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisdiakur%2Frerror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborisdiakur%2Frerror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisdiakur%2Frerror/lists"}