{"id":37904398,"url":"https://github.com/loadingio/lderror","last_synced_at":"2026-01-20T17:27:06.981Z","repository":{"id":41530713,"uuid":"207941253","full_name":"loadingio/lderror","owner":"loadingio","description":"simple wrapper for Error object.","archived":false,"fork":false,"pushed_at":"2025-10-05T07:42:30.000Z","size":265,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T00:24:51.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loadingio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-09-12T01:47:36.000Z","updated_at":"2025-10-05T07:41:07.000Z","dependencies_parsed_at":"2024-01-18T05:41:47.509Z","dependency_job_id":"18e4050d-6110-419a-83f5-8228d40c22b8","html_url":"https://github.com/loadingio/lderror","commit_stats":{"total_commits":90,"total_committers":1,"mean_commits":90.0,"dds":0.0,"last_synced_commit":"b559d31f14540113c34706e31a69dc38f6013f98"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/loadingio/lderror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Flderror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Flderror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Flderror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Flderror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadingio","download_url":"https://codeload.github.com/loadingio/lderror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Flderror/sbom","scorecard":{"id":596464,"data":{"date":"2022-08-15","repo":{"name":"github.com/loadingio/lderror","commit":"c565202d4d4d497b6d42d529086093966b328b50"},"scorecard":{"version":"v4.5.0-26-g10b6052","commit":"10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93"},"score":4.7,"checks":[{"name":"Code-Review","score":0,"reason":"no reviews found","details":["Warn: no reviews found for commit: c565202d4d4d497b6d42d529086093966b328b50","Warn: no reviews found for commit: 0293d9905d73352a4cc34987f1602a28cf1cdddd","Warn: no reviews found for commit: d9045de3c5beac929511d891c1123c7f412571fc","Warn: no reviews found for commit: faaa3df372059d7d023e68d481df8c0600773b49","Warn: no reviews found for commit: 9f5f67f53d9e432e1649aefc761643f41dadfd30","Warn: no reviews found for commit: df14521bcc7ae2c82a931e6548e51503a2b42245","Warn: no reviews found for commit: 48bec8ed677d85860990263d146cb2ec5732a7ea","Warn: no reviews found for commit: 58a3a183999ade5b086d9f89e68ab2bf5e036767","Warn: no reviews found for commit: 5919570b0be6c6b4e79ea38f362c4e3f479f8007","Warn: no reviews found for commit: 7eb7e93b0d86a4187d9797c7514403f3a88f7dd8","Warn: no reviews found for commit: 8725e338404dc53a07b627c0e28f3781504af1c4","Warn: no reviews found for commit: a881d8d1b0147ca3b65c07aac998c8af63344589","Warn: no reviews found for commit: 17aa584cbae58735cc701e51918d3aabe475470e","Warn: no reviews found for commit: ca82a7ff1d84323ffd0dd6890263dc6e83e7f173","Warn: no reviews found for commit: 6eaaa3cfd5d0e98e90aea63b7325a2614ce0422f","Warn: no reviews found for commit: d59c75202056186343876602d90facd423b606b7","Warn: no reviews found for commit: d3d08fa785fe71e0a9ba945b3855f8bd47d65834","Warn: no reviews found for commit: 170a0104f4b589f2254c5734be9a2723ceaa35cd","Warn: no reviews found for commit: 1d6fa2fc0993f6c8d514240ee60caa4f56e50d16","Warn: no reviews found for commit: ff03946db1a0c14d23812975123ef0f9ceeb42d9","Warn: no reviews found for commit: 892457597c5ef8fc199fcea251bad87f835b8975","Warn: no reviews found for commit: 1cd82f0eb028fedd28206ac56b175084444a7046","Warn: no reviews found for commit: 392376d2ca08a98bd99407f97d66aa03a47ad235","Warn: no reviews found for commit: b1752f10ac51867fb24ba7d2e06d6fdd7e823a89","Warn: no reviews found for commit: a44f67c08e5ffd3ce0b6645410d645f85063f718","Warn: no reviews found for commit: 6b32e833f38f3bdb09c3fc5aaffe5ee112b54070","Warn: no reviews found for commit: 99a8880bc531f3af3d8909f8f2b570550a6b948a","Warn: no reviews found for commit: ed7ef6c191ce681e2a65d94350218f6176568b39","Warn: no reviews found for commit: a8c68c1ccd9a960f411ca9a2b2806656df8fdc2a","Warn: no reviews found for commit: 43a92d38b926b704d78a6fcd858d4982162e8c95"],"documentation":{"short":"Determines if the project requires code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#code-review"}},{"name":"Maintained","score":6,"reason":"8 commit(s) out of 30 and 0 issue activity out of 0 found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no badge detected","details":null,"documentation":{"short":"Determines if the project has a CII Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"no vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#vulnerabilities"}},{"name":"Token-Permissions","score":10,"reason":"tokens are read-only in GitHub workflows","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"no published package detected","details":["Warn: no GitHub 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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#packaging"}},{"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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#dangerous-workflow"}},{"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/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info: GitHub-owned GitHubActions are pinned","Info: Third-party GitHubActions are pinned","Info: Dockerfile dependencies are pinned","Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles","Info: no insecure (not pinned by hash) dependency downloads found in shell scripts"],"documentation":{"short":"Determines if the project has declared and pinned its dependencies.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#pinned-dependencies"}},{"name":"License","score":0,"reason":"license file not detected","details":null,"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":null,"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":0,"reason":"0 out of 5 artifacts are signed or have provenance","details":["Warn: release artifact v2.3.1 does not have provenance: https://api.github.com/repos/loadingio/lderror/releases/73720356","Warn: release artifact v2.3.1 not signed: https://api.github.com/repos/loadingio/lderror/releases/73720356","Warn: release artifact v2.3.0 does not have provenance: https://api.github.com/repos/loadingio/lderror/releases/70609165","Warn: release artifact v2.3.0 not signed: https://api.github.com/repos/loadingio/lderror/releases/70609165","Warn: release artifact v2.2.0 does not have provenance: https://api.github.com/repos/loadingio/lderror/releases/65071284","Warn: release artifact v2.2.0 not signed: https://api.github.com/repos/loadingio/lderror/releases/65071284","Warn: release artifact v2.1.2 does not have provenance: https://api.github.com/repos/loadingio/lderror/releases/60552316","Warn: release artifact v2.1.2 not signed: https://api.github.com/repos/loadingio/lderror/releases/60552316","Warn: release artifact v2.1.0 does not have provenance: https://api.github.com/repos/loadingio/lderror/releases/59508158","Warn: release artifact v2.1.0 not signed: https://api.github.com/repos/loadingio/lderror/releases/59508158"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":null,"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#fuzzing"}},{"name":"Dependency-Update-Tool","score":0,"reason":"no update tool detected","details":["Warn: dependabot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others.","Warn: renovatebot config file not detected in source location.\n\t\t\tWe recommend setting this configuration in code so it can be easily verified by others."],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/10b6052acfb4f0b8136bc4876cb6f5b6f26bfe93/docs/checks.md#dependency-update-tool"}}]},"last_synced_at":"2025-08-20T23:15:38.129Z","repository_id":41530713,"created_at":"2025-08-20T23:15:38.129Z","updated_at":"2025-08-20T23:15:38.129Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":[],"created_at":"2026-01-16T17:08:22.349Z","updated_at":"2026-01-16T17:08:25.903Z","avatar_url":"https://github.com/loadingio.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lderror\n\nSimple wrapper for Error object.\n\n## Usage\n\nlderror contains an `id` field for identify what kind of error it is. to create a lderror object, simply:\n\n    new lderror(1000);\n    new lderror(\"custom message\", 1000);\n    new lderror({message: \"custom message\", id: 1000});\n    lderror(1000); /* auto new upon invocation */\n    lderror(1002,\"additional information\")\n    lderror(\"custom message\"); /* by default, id will be 0 */\n\nvalid lderror object contains a field 'name' with value 'lderror', and an id field with values listed in `src/lde.ls`. Following demonstrates how to make a lderror-compatible error object with id 1000 by duck typing:\n\n    new Error! \u003c\u003c\u003c {id: 1000, name: \"lderror\"}\n\nor\n\n    Object.assign(new Error(), {id: 1000, name: \"lderror\"});\n\n\n## Members\n\n - `id`: lderror defined error code.\n - `message`: custom error message (optional)\n - `stack`: stacktrace (optional)\n - `code`: http status code, if applicable (optional)\n - `log`: should this error be logged. default false.\n - `error`: an Error object constructed\n\n\n## Helper Functions\n\nlderror exports several help functions for making use lderror easier:\n\n - `lderror.id(err)`: get the id for an error object `err`.\n   - return value:\n     - `err.id` if `err` is a valid `lderror` object and `lderror.id` is defined.\n     - otherwise, 0\n   - alternatively you can get `id` by accessing `err.id` directly - while this is not recommended..\n - `lderror.message(err)`: get the message corresponding to input `err` where `err` is either:\n   - a number: return the message corresponding to given error id\n   - an object: return the message corresponding to `err.id`\n   - return `lderror.message(0)` if none of above, or return message of above is empty.\n - `lderror.reject(...)`: shorthand for `Promise.reject(new lderror(...))`\n - `lderror.handler(opt)`: a constructor function. when constructed, return an error handler\n   - return a function `func(err)` for handling `err`. this function also exposes below method:\n     - `isOn()`: return true if there are any ongoing errors, otherwise false.\n   - options:\n     - `ignore`: a list of id to ignore in this handler. error `999` is always ignored.\n     - `rule(id)`: convert an error `id` to an user-defined object `o`, which is passed to `handler` below.\n       - by default, `rule` is `function(id) { return id; }`\n     - `handler(o, e)`: a actual handler for handling the given error\n       - should return a promise.\n       - options:\n         - `o`: user-defined object returned by `rule(id)`.\n         - `e`: the original error object.\n - `lderror.eventHandler`: helper event handler. See below section for more information.\n   - `eventHandler` provides two member functions:\n     - `error(evt)`: handler for `error` event.\n     - `rejection(evt)`: handler for `unhandledrejection` event.\n   - for both functions, return true if `lderror` is handled. otherwise false.\n\n\n### Error Handler\n\nHelper to contruct a reusable Error handler which supports:\n\n - custom error object wrapper / converter\n - id list of lderror to ignore\n - customizable handler\n\n\nA sample scenario of using `lderror.handler`:\n\n    handler = new lderror.handler({\n      handler: function(o,e) {\n        return Promise.resolve(alert(\"error: \", o, e));\n      }\n    });\n\n    doSomething(...)\n      .then(...)\n      .catch(handler);\n\n\nWork along with `@plotdb/block` + `ldcvmgr`:\n\n    @manager = new block.manager!\n    @ldcvmgr = new ldcvmgr {manager}\n    handler = new lderror.handler do\n      ignore: \u003c[1005 1004]\u003e\n      handler: (~\u003e @ldcvmgr.toggle it )\n      rule: (id) -\u003e \"error/#id\"\n\n    doSomething ...\n      .then ...\n      .catch handler\n\n\n## error / unhandledrejection events\n\nYou can use `lderror.eventHandler.error` and `lderror.eventHandler.rejection` to take care of lderror related errors:\n\n    window.addEventListenen(\"error\", lderror.eventHandler.error);\n    window.addEventListenen(\"unhandledrejection\", lderror.eventHandler.rejection);\n\nThese handlers simply check if incoming error is a lderror with original error object; if it is, additional information is logged and the original error object will be thrown for showing stacktrace information.\n\nTo wrap them along with your own event handler, test its return value and proceed if it returns `false`:\n\n    window.addEventListenen(\"error\", function(evt) {\n      if(!lderror.eventHandler.error) { /* your own handler */ }\n    });\n\n\n## Customized Information\n\nAdditional information can be added if needed:\n\n - redirect - instruct a redirect url in order to proper take care of this error.\n - data - supplementary data (serializable)\n\n\n## Customized Error ID\n\nUse ID `10000` ~ `29999` for customized error.\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Flderror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadingio%2Flderror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Flderror/lists"}