Skip to content

fix: password tip - #3325

Merged
Keith-CY merged 1 commit into
developfrom
feat-438
Mar 11, 2025
Merged

fix: password tip#3325
Keith-CY merged 1 commit into
developfrom
feat-438

Conversation

@devchenyan

Copy link
Copy Markdown
Contributor

@Keith-CY
Keith-CY requested a review from Copilot March 10, 2025 06:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Overview

The PR aims to improve the error handling for incorrect password scenarios during offline signing by introducing a dedicated exception.

  • Import a new exception, IncorrectPassword, from the exceptions module.
  • Add a check in the error handling logic to throw the new IncorrectPassword exception when the password is incorrect.

Reviewed Changes

File Description
packages/neuron-wallet/src/controllers/offline-sign.ts Adds specific error handling for password errors by importing IncorrectPassword and checking for the error message

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

result: signer.toJSON(),
}
} catch (err) {
if (err.message === 'Incorrect password!') {

Copilot AI Mar 10, 2025

Copy link

Choose a reason for hiding this comment

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

Using a hard-coded string to check for an incorrect password may be brittle if the error message changes. Consider using a dedicated error code or property to reliably identify the error.

Suggested change
if (err.message === 'Incorrect password!') {
if (err.code === 'INCORRECT_PASSWORD') {

Copilot uses AI. Check for mistakes.
@silySuper

silySuper commented Mar 10, 2025

Copy link
Copy Markdown

/package
Packaging for test is done in 13758504353. @silySuper

@Keith-CY
Keith-CY enabled auto-merge March 11, 2025 02:33
@Keith-CY
Keith-CY disabled auto-merge March 11, 2025 02:45
@Keith-CY
Keith-CY merged commit 423785a into develop Mar 11, 2025
@Keith-CY
Keith-CY deleted the feat-438 branch March 11, 2025 02:45
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.

5 participants