Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

on('error') in stream mode seems not work as the document said #97

Closed
yanxyz opened this issue Sep 8, 2015 · 2 comments
Closed

on('error') in stream mode seems not work as the document said #97

yanxyz opened this issue Sep 8, 2015 · 2 comments
Labels
bug Something does not work as it should

Comments

@yanxyz
Copy link

yanxyz commented Sep 8, 2015

Example code:

'use strict'

const got = require('got')
const url = 'https://github.com/xxx.jpg'

got(url, function (err) {
  console.log(err.statusCode) // 406
})

got(url)
.catch(function (err) {
  console.log(err.statusCode) // 406
})

got.stream(url)
.on('error', function (err) {
  console.log(err.statusCode) // output nothing, seams that there is no error event
})
@floatdrop floatdrop added the bug Something does not work as it should label Sep 8, 2015
@floatdrop
Copy link
Contributor

Fixed in 4.2.0

@yanxyz
Copy link
Author

yanxyz commented Sep 9, 2015

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as it should
Projects
None yet
Development

No branches or pull requests

2 participants