Skip to content

crypto: add internal error codes - #37650

Merged
aduh95 merged 1 commit into
nodejs:masterfrom
RaisinTen:crypto/add-internal-error-codes
Mar 13, 2021
Merged

crypto: add internal error codes#37650
aduh95 merged 1 commit into
nodejs:masterfrom
RaisinTen:crypto/add-internal-error-codes

Conversation

@RaisinTen

Copy link
Copy Markdown
Member

According to addaleax's comment here: #37555 (review)

Maybe we could also expand CryptoErrorVector in the future to forward error codes, rather than just plain strings, so that the errors become more programatically accessible?

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 7, 2021
Comment threadsrc/crypto/crypto_util.cc Outdated
@RaisinTen

Copy link
Copy Markdown
MemberAuthor

cc @addaleax@jasnell

Comment threadsrc/crypto/crypto_util.cc Outdated
Comment threadsrc/crypto/crypto_util.cc Outdated
@RaisinTen
RaisinTen marked this pull request as ready for review March 9, 2021 14:22
@RaisinTen
RaisinTenforce-pushed the crypto/add-internal-error-codes branch 2 times, most recently from 8bdf37e to 703bbf0CompareMarch 9, 2021 14:31
Comment threadsrc/crypto/crypto_util.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need to go into a crypto_util-inl.h file at some point (because template functions are implicitly also inline functions), but if this works right now, it should be fine 👍

@RaisinTenRaisinTenMar 9, 2021

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax I don't think we have a crypto_util-inl.h.
I did find -name crypto_util-inl.h and couldn't find it. 👀

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry for being unclear – this would be the first function in that file :)

@RaisinTenRaisinTenMar 9, 2021

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax Moved it to src/crypto/crypto_util-inl.h. I noticed a couple of other template functions and classes in src/crypto/crypto_util.h. Should we move those to src/crypto/crypto_util-inl.h as well (in another PR)?

Also,

../src/crypto/crypto_util.h:351:14: error: no matching member function for call to 'TrackField' tracker->TrackField("errors", errors_); ~~~~~~~~~^~~~~~~~~~

To fix this, should I again change CryptoErrorStore to inherit from std::vector<std::string> or is there another way?

@RaisinTenRaisinTen added the wip Issues and PRs that are still a work in progress. label Mar 10, 2021
@RaisinTen
RaisinTenforce-pushed the crypto/add-internal-error-codes branch 2 times, most recently from 5231d3d to 4ff9e88CompareMarch 10, 2021 13:09
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@RaisinTenRaisinTen removed the wip Issues and PRs that are still a work in progress. label Mar 11, 2021
@RaisinTen

Copy link
Copy Markdown
MemberAuthor

cc @addaleax@jasnell
Could this have another review please?
I had to change NO_ERROR to OK because msvc seems to have a constant going by the same name.

@RaisinTenRaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 11, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

nodejs-github-bot commented Mar 12, 2021

Copy link
Copy Markdown
Collaborator

PR-URL: nodejs#37650
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95
aduh95force-pushed the crypto/add-internal-error-codes branch from 6ff54c7 to a28cb93CompareMarch 13, 2021 08:54
@aduh95

Copy link
Copy Markdown
Contributor

Landed in a28cb93

@aduh95
aduh95 merged commit a28cb93 into nodejs:masterMar 13, 2021
@RaisinTen
RaisinTen deleted the crypto/add-internal-error-codes branch March 13, 2021 11:53
danielleadams pushed a commit that referenced this pull request Mar 16, 2021
PR-URL: #37650
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadamsdanielleadams mentioned this pull request Mar 16, 2021
danielleadams pushed a commit that referenced this pull request Mar 16, 2021
PR-URL: #37650
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@RaisinTen@nodejs-github-bot@aduh95@jasnell@addaleax@targos