{"id":28157073,"url":"https://github.com/amkjs/amk-error","last_synced_at":"2025-05-15T08:17:36.430Z","repository":{"id":57177340,"uuid":"103824002","full_name":"amkjs/amk-error","owner":"amkjs","description":"http response error object for amkjs","archived":false,"fork":false,"pushed_at":"2018-09-07T04:03:07.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T22:49:10.958Z","etag":null,"topics":["amkjs","error-handling","http-errors"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/amkjs.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}},"created_at":"2017-09-17T11:35:36.000Z","updated_at":"2018-09-07T04:03:08.000Z","dependencies_parsed_at":"2022-08-24T14:40:46.376Z","dependency_job_id":null,"html_url":"https://github.com/amkjs/amk-error","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amkjs%2Famk-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amkjs%2Famk-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amkjs%2Famk-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amkjs%2Famk-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amkjs","download_url":"https://codeload.github.com/amkjs/amk-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301583,"owners_count":22047907,"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":["amkjs","error-handling","http-errors"],"created_at":"2025-05-15T08:16:09.286Z","updated_at":"2025-05-15T08:17:36.406Z","avatar_url":"https://github.com/amkjs.png","language":"JavaScript","readme":"# AMK-ERROR\r\n\r\n[![CircleCI](https://circleci.com/gh/amkjs/amk-error.svg?style=svg)](https://circleci.com/gh/amkjs/amk-error)\r\n[![codecov](https://codecov.io/gh/amkjs/amk-error/branch/master/graph/badge.svg)](https://codecov.io/gh/amkjs/amk-error)\r\n[![Known Vulnerabilities](https://snyk.io/test/github/amkjs/amk-error/badge.svg?targetFile=package.json)](https://snyk.io/test/github/amkjs/amk-error?targetFile=package.json)\r\n\r\n\r\nhttp response error object for amk js\r\n\r\n## Usage\r\n\r\nto install: `npm i amk-error`\r\n\r\nto use:\r\n```\r\nconst ErrorObject = require('amk-error');\r\n\r\nthrow new ErrorObject('Not found', 404);\r\n```\r\n\r\n## API\r\n\r\n#### ```constructor(message, status)```\r\n---\r\nCreating an error object\r\n\r\n##### Arguments\r\n* **message** **_(string)_** - message regarding the error (default: Something went wrong)\r\n* **status** **_(number)_** - http status code, will only accept 400 to 599. (default is 500)\r\n\r\n## Tests\r\n1. install dependencies using `npm install`\r\n2. run `npm test`\r\n\r\n## Feedback\r\n\r\nAll bugs, feature requests, pull requests, feedback, etc., are welcome. [Create an issue](https://github.com/amkjs/amk-error/issues).\r\n\r\n## License\r\n[MIT](https://github.com/amkjs/amk-error/blob/master/LICENSE)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famkjs%2Famk-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famkjs%2Famk-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famkjs%2Famk-error/lists"}