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

lib: Rewrite "credentials" as a TypeScript class #21461

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mvollmer
Copy link
Member

No description provided.

So that we can do "if (err instanceof cockpit.ProcessError)" in catch
clauses.
@mvollmer mvollmer force-pushed the lib-type-credentials branch from 2f73b05 to b3af36e Compare December 20, 2024 12:36
This requires its users to treat it as a class and not pass around
divorced methods.
@mvollmer mvollmer force-pushed the lib-type-credentials branch from b3af36e to 2025537 Compare December 20, 2024 15:16
@@ -198,25 +229,29 @@ function Keys() {
try {
await proc;
} catch (ex) {
if (ex.exit_status)
if (ex instanceof cockpit.ProcessError && ex.exit_status)
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test.

Comment on lines +299 to +301
ex = new KeyLoadError(sent_password, failure);
else if (error instanceof Error)
ex = new KeyLoadError(sent_password, error.message);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 3 added lines are not executed by any test.

else if (error instanceof Error)
ex = new KeyLoadError(sent_password, error.message);
else
ex = error;
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test.

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.

2 participants