镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Can we refactor opensslErrorStack? #16521

Description

@jasnell

Errors thrown from inside node_crypto might contain an additional opensslErrorStack property. This property is generally undocumented save one reference here and I am unable to find any mentions of the property in use anywhere (GitHub and Google searches show no mentions of the property outside of our own errors.md doc and test-crypto.js file).

Keeping it around seems significantly less than useful. I propose deprecating the property and changing things such that if (and only if) we are in a DEBUG build, the openssl stack trace can be output to the console immediately before the associated js error is thrown.

@nodejs/crypto @nodejs/tsc

Activity

  1. bnoordhuis commented on Oct 26, 2017

    @bnoordhuis
    Member

    I am unable to find any mentions of the property in use anywhere (GitHub and Google searches show no mentions of the property outside of our own errors.md doc and test-crypto.js file).

    That's because it was only added last month: #15518

  2. jasnell commented on Oct 26, 2017

    @jasnell
    MemberAuthor

    Ugh. That's right. I thought it looked familiar. I hadn't managed to get back around to reviewing that pr and totally forgot about it. Given that it's so new, then, perhaps we can refactor it a bit. As it stands it makes converting to internal/errors more difficult

  3. mscdex commented on Oct 26, 2017

    @mscdex
    Contributor

    -1 to deprecating. The most recent OpenSSL error on the error stack is not always very helpful, so having the rest of the stack available can shed light on what the problem actually is.

    BTW I was the one who initially requested this extra information be made available in one form or another.

  4. jasnell commented on Oct 26, 2017

    @jasnell
    MemberAuthor

    Reminder to self: git blame is your friend

  5. changed the title [-]Can we deprecate opensslErrorStack?[/-] [+]Can we refactor opensslErrorStack?[/+] on Oct 26, 2017
  6. jasnell commented on Oct 26, 2017

    @jasnell
    MemberAuthor

    Changed the title of this to refactor rather than deprecate. I'd like to see if there's a better way for us to surface these details that would make the migration to internal/errors easier...

  7. added
    cryptoIssues and PRs related to the crypto subsystem.
    questionIssues asking questions about Node.js.
    on Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions