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

Clean up error codes in napi somewhat #13179

Merged
merged 7 commits into from
Aug 13, 2024
Merged

Clean up error codes in napi somewhat #13179

merged 7 commits into from
Aug 13, 2024

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

Clean up error codes in napi somewhat

How did you verify your code works?

@Jarred-Sumner Jarred-Sumner requested a review from 190n August 8, 2024 23:40
Copy link
Contributor

github-actions bot commented Aug 8, 2024

@Jarred-Sumner, clang-tidy had something to share with you about your code:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 13  372M   13 50.4M    0     0  40.5M      0  0:00:09  0:00:01  0:00:08 50.6M
 34  372M   34  127M    0     0  56.9M      0  0:00:06  0:00:02  0:00:04 64.0M
 53  372M   53  199M    0     0  61.6M      0  0:00:06  0:00:03  0:00:03 66.7M
 72  372M   72  270M    0     0  63.6M      0  0:00:05  0:00:04  0:00:01 67.5M
 92  372M   92  346M    0     0  66.0M      0  0:00:05  0:00:05 --:--:-- 69.2M
100  372M  100  372M    0     0  66.8M      0  0:00:05  0:00:05 --:--:-- 74.4M

Commit: 8ec6a1c

Comment on lines 1234 to 1243
if (catchScope.exception()) {
catchScope.clearException();
return {};
}
}

if (catchScope.exception()) {
catchScope.clearException();
return {};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

are these redundant?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so. This check should be deleted because it looks like the one above would catch any exceptions

}
*result = reinterpret_cast<napi_value>(error);

Copy link
Collaborator Author

@Jarred-Sumner Jarred-Sumner Aug 13, 2024

Choose a reason for hiding this comment

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

*result = toNapi(err);

@Jarred-Sumner Jarred-Sumner merged commit 4304368 into main Aug 13, 2024
43 of 46 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/napi-err branch August 13, 2024 19:42
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

Successfully merging this pull request may close these issues.

4 participants