{"id":22747207,"url":"https://github.com/one-com/node-createerror","last_synced_at":"2025-04-14T11:40:30.227Z","repository":{"id":4503883,"uuid":"5643352","full_name":"One-com/node-createerror","owner":"One-com","description":"Helper for creating easily extensible and subclassable JavaScript Error classes.","archived":false,"fork":false,"pushed_at":"2023-04-14T21:09:48.000Z","size":48,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-12T06:38:28.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/One-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-09-01T21:09:25.000Z","updated_at":"2024-07-25T02:01:45.000Z","dependencies_parsed_at":"2023-07-05T20:16:43.372Z","dependency_job_id":null,"html_url":"https://github.com/One-com/node-createerror","commit_stats":{"total_commits":46,"total_committers":6,"mean_commits":7.666666666666667,"dds":"0.17391304347826086","last_synced_commit":"c99d15f43553af59e70a70742140608fed8b6eca"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnode-createerror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnode-createerror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnode-createerror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnode-createerror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-com","download_url":"https://codeload.github.com/One-com/node-createerror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248874209,"owners_count":21175791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-12-11T03:13:42.717Z","updated_at":"2025-04-14T11:40:30.180Z","avatar_url":"https://github.com/One-com.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-createerror\n================\n\nHelper for creating easily extensible and subclassable JavaScript Error classes.\n\nInstallation\n------------\n\nMake sure you have node.js and npm installed, then run:\n\n    npm install createerror\n\nUsage\n-----\n\n    var createError = require('createerror');\n\n    var MyError = createError({\n        name: 'MyError',\n        // Used when no message is handed to the constructor:\n        message: 'A slightly longer description of the error'\n    });\n\nInstances can carry extra data about the error:\n\n    try {\n        throw new MyError({\n            message: \"The message\", // Not mandatory\n            data: {disallowedIds: [1, 3, 4, 6]}\n        });\n    } catch(e) {\n        console.warn(e.data); // {disallowedIds: [1, 3, 4, 6]}\n    }\n\nInheriting from an existing Error class (the Error classes in the\n[httpErrors](https://github.com/One-com/node-httperrors)  module also use\n`createError`):\n\n    var httpErrors = require('httperrors');\n\n    var NotFoundUnderTheBedError = createError({\n        name: 'NotFoundUnderTheBed',\n        message: 'I looked under the bed, but it was not found'\n    }, httpErrors.NotFound);\n\nInstances of this error walk and quack like `httpErrors.NotFound` instances, of course:\n\n    var ohDear = new NotFoundUnderTheBedError('No monsters today');\n    console.warn(ohDear.NotFound); // true\n    console.warn(ohDear.NotFoundUnderTheBed); // true\n\n\nLicense\n-------\n\n3-clause BSD license -- see the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fnode-createerror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-com%2Fnode-createerror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fnode-createerror/lists"}