Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use error.code instead of error.message to compare errors #981

Closed
szmarczak opened this issue Dec 10, 2019 · 5 comments · Fixed by #1051
Closed

Use error.code instead of error.message to compare errors #981

szmarczak opened this issue Dec 10, 2019 · 5 comments · Fixed by #1051
Labels
enhancement This change will extend Got features ✭ help wanted ✭

Comments

@szmarczak
Copy link
Collaborator

szmarczak commented Dec 10, 2019

7b2ccb0#r36353721

@szmarczak szmarczak added the enhancement This change will extend Got features label Dec 10, 2019
@szmarczak szmarczak mentioned this issue Feb 6, 2020
18 tasks
@rlr
Copy link

rlr commented Feb 7, 2020

Here is the stack trace I am getting on latest 10.5.2 version (see also #1014)

ReadError: premature close
  File "/home/node/guardian-website/node_modules/got/dist/source/as-promise.js", line 58, col 27, in EventEmitter.<anonymous>
    emitError(new errors_1.ReadError(error, options));
  File "internal/process/task_queues.js", line 94, col 5, in processTicksAndRejections
  File "/home/node/guardian-website/node_modules/end-of-stream/index.js", line 53, col 86, in onclosenexttick
    if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  File "internal/process/task_queues.js", line 76, col 11, in processTicksAndRejections

@szmarczak
Copy link
Collaborator Author

@rlr What Node.js version are you using?

@szmarczak
Copy link
Collaborator Author

Are you using a bundler?

@rlr
Copy link

rlr commented Feb 10, 2020

Node v12.15.0.

No bundling. My code goes through tsc to convert typescript to js but node_modules isn't touched.

@szmarczak
Copy link
Collaborator Author

Interestingly it uses /node_modules/end-of-stream/index.js instead of the native end-of-stream 🤔

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement This change will extend Got features ✭ help wanted ✭
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants