{"id":15747396,"url":"https://github.com/lbdremy/node-httperror","last_synced_at":"2025-06-29T14:32:39.469Z","repository":{"id":6781698,"uuid":"8028866","full_name":"lbdremy/node-httperror","owner":"lbdremy","description":"HTTPError class extends Error (stack in). var err = new HTTPError(req,res,message);","archived":false,"fork":false,"pushed_at":"2015-04-15T09:45:48.000Z","size":151,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-22T12:19:20.872Z","etag":null,"topics":["httperror","nodejs"],"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/lbdremy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-05T12:46:12.000Z","updated_at":"2024-01-22T06:54:29.000Z","dependencies_parsed_at":"2022-09-18T11:02:06.423Z","dependency_job_id":null,"html_url":"https://github.com/lbdremy/node-httperror","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lbdremy/node-httperror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbdremy%2Fnode-httperror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbdremy%2Fnode-httperror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbdremy%2Fnode-httperror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbdremy%2Fnode-httperror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbdremy","download_url":"https://codeload.github.com/lbdremy/node-httperror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbdremy%2Fnode-httperror/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262609113,"owners_count":23336631,"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":["httperror","nodejs"],"created_at":"2024-10-04T05:05:17.203Z","updated_at":"2025-06-29T14:32:39.449Z","avatar_url":"https://github.com/lbdremy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httperror - HTTPError class for node.js\n\n## Install\n\n```sh\nnpm install httperror\n```\n\n## Usage\n\n```js\nvar http = require('http');\nvar HTTPError = require('httperror');\n\nvar req = http.get('http://google.com',function(res){\n\tvar err = new HTTPError(req,res,'Querying google.com');\n\tthrow err;\n});\n// Output\n// HTTPError: Querying google.com\n// Request URL: http://google.com/\n// Request method: GET\n// Status code: 301 - Moved Permanently\n// Request headers:\n// host: google.com\n// Response headers:\n// location: http://www.google.com/\n// content-type: text/html; charset=UTF-8\n// date: Sun, 06 Oct 2013 23:22:07 GMT\n// expires: Tue, 05 Nov 2013 23:22:07 GMT\n// cache-control: public, max-age=2592000\n// server: gws\n// content-length: 219\n// x-xss-protection: 1; mode=block\n// x-frame-options: SAMEORIGIN\n// alternate-protocol: 80:quic\n//     at ClientRequest.\u003canonymous\u003e (/home/lbdremy/workspace/nodejs/HTTPError/example/http.js:5:12)\n//     at ClientRequest.g (events.js:192:14)\n//     at ClientRequest.EventEmitter.emit (events.js:96:17)\n//     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1588:7)\n//     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)\n//     at Socket.socketOnData [as ondata] (http.js:1491:20)\n//     at TCP.onread (net.js:404:27)\n\n```\n\n__N.B:__ This constructor does not make any difference between the _\"good or bad\"_ status code. It will create an error whatever request/response you give to its.\n\n## Test\n\n```sh\nnpm test\n```\n\n## Licence\n\n(The MIT License)\n\nCopyright 2013 Rémy Loubradou\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbdremy%2Fnode-httperror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbdremy%2Fnode-httperror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbdremy%2Fnode-httperror/lists"}