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

-71 instead of EPROTO error #31438

Closed
DanielRuf opened this issue Jan 21, 2020 · 6 comments
Closed

-71 instead of EPROTO error #31438

DanielRuf opened this issue Jan 21, 2020 · 6 comments

Comments

@DanielRuf
Copy link

DanielRuf commented Jan 21, 2020

  • Version: 13.6.0
  • Platform: Ubuntu
  • Subsystem:

It seems with Node 13(.6.0) error codes are numeric now which produces failing snapshot tests and assertions.

Before Node 13: EPROTO
Starting with Node 13: -71

Is there some information about this or was this just a bug and is this already fixed?

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
    -   "error": "EPROTO",
    +   "error": -71,
        "id": null,
      }

      130 |             });
      131 |             client.on('error', (err) => {
    > 132 |                 expect(err).toEqual({ id: null, error: 'EPROTO' });
          |                             ^
      133 |                 done();
      134 |             });
      135 |             client.Authentication.login(USER.email, USER.password, null);

      at Client.<anonymous> (tests/authentication/authentication.test.js:132:29)
      at Authentication.callback (dist/bundle.cjs.js:164:29)
      at Request._callback (dist/bundle.cjs.js:100:28)
      at self.callback (node_modules/request/request.js:185:22)
      at Request.Object.<anonymous>.Request.onRequestError (node_modules/request/request.js:881:8)
@addaleax
Copy link
Member

Can you maybe share more information about how to reproduce this?

@richardlau
Copy link
Member

If you're using the errno field it was deliberate: #28140

@DanielRuf
Copy link
Author

DanielRuf commented Jan 21, 2020

If you're using the errno field it was deliberate: #28140

Seems this is the cause, yes.

@bnoordhuis
Copy link
Member

You should probably check against the .code field now rather than .errno.

@DanielRuf
Copy link
Author

We found the culprit. It was caused by another module.

Thanks for the clarificartion and information.
Closing as resolved.

@DanielRuf
Copy link
Author

I think what we miss here is some history / deprecation or breaking change info:

https://nodejs.org/api/errors.html#errors_error_errno

At least I see none like in other modules. Only 10 history references for a few errors. But no info about the change. This makes it a bit harder to keep track or understand when it was changed and why.

https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback

Unless we take a look at the changelog.

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V13.md#2019-10-22-version-1300-current-bethgriggs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants