Some errors can't be caught
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- api, networking
Research direction
Start with the supplied Node.js reproduction and trace the request entry point used by needle('get', ...) through its Promise and protocol-error handling. Verify that the reported protocol-related error reaches the attached catch handler without crashing Node, using the example as the completion check.
Written by the indexing model from the issue text.
Description
Please see below code. Error produced by it is not possible to catch and it crashes node.
const http = require("http"),
https = require("https"),
url = require("url"),
needle = require("needle");
const agent = {
http: new http.Agent({ keepAlive: true }),
https: new https.Agent({ keepAlive: true })
};
let parsedUrl = url.parse('http://img.tesco.com/Groceries/pi/722/5053990138722/IDShot_540x540.jpg');
let origin_resp = needle('get','http://img.tesco.com/Groceries/pi/722/5053990138722/IDShot_540x540.jpg',{ follow_max: 5, agent: (parsedUrl.protocol == "http:") ? agent.http : agent.https}).then(resp=>{console.log(resp)}).catch(err=>{console.error(err)});
There should be some way to catch such protocol related errors as they can be huge issue if not caught in production.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tomas/needle
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100