Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export const AddContextError = createErrorClass('AddContextError');
export const SetSignatureError = createErrorClass('SetSignatureError');
export const GetAppCallbackUrlError = createErrorClass("GetAppCallbackUrlError");
export const StatusUrlError = createErrorClass('StatusUrlError');
export const InavlidParametersError = createErrorClass('InavlidParametersError');
export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');
export const InvalidParametersError = createErrorClass('InvalidParametersError');
export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');
Comment on lines +39 to +40
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Preserve backward compatibility with a deprecated alias

Downstream users may currently import/compare against the misspelled InavlidParametersError. To avoid a breaking change, keep a deprecated alias that points to the same class object.

Apply this minimal, non-breaking alias:

 export const InvalidParametersError = createErrorClass('InvalidParametersError');
+/** @deprecated Use InvalidParametersError (fixed spelling). This alias will be removed in a future major release. */
+export const InavlidParametersError = InvalidParametersError;
 export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');

Run this quick check to find internal usages that still reference the old name or compare error.name to the misspelled string:


🏁 Script executed:

#!/bin/bash
# Find symbol imports/usages of the old misspelling
rg -nP -C2 '\bInavlidParametersError\b' --type ts --type tsx --type js --type jsx -g '!**/dist/**'

# Find string comparisons against the old error name
rg -nP -C2 'error\.name\s*===\s*["'\'']InavlidParametersError["'\'']' --type ts --type tsx --type js --type jsx -g '!**/dist/**'

Length of output: 287


🏁 Script executed:

#!/bin/bash
# Search for misspelled alias usage in source files
rg -nP -C2 '\bInavlidParametersError\b' --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.jsx' --glob '!**/dist/**'

# Search for string comparisons against the misspelled error name
rg -nP -C2 'error\.name\s*===\s*["'\'']InavlidParametersError["'\'']' --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.jsx' --glob '!**/dist/**'

Length of output: 2336


Preserve backward compatibility by adding a deprecated alias for the misspelled error

The codebase still imports and throws InavlidParametersError in src/utils/validationUtils.ts, so adding a deprecated alias is required to avoid breaking those references. Once downstream and internal imports have been updated to the correctly spelled InvalidParametersError, the alias can be removed in a future major release.

Locations needing attention:

  • src/utils/errors.ts: add the alias
  • src/utils/validationUtils.ts: current imports and throws reference the misspelling

Suggested change:

 export const InvalidParametersError = createErrorClass('InvalidParametersError');
+/** @deprecated Use InvalidParametersError (fixed spelling). This alias will be removed in a future major release. */
+export const InavlidParametersError = InvalidParametersError;
 export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const InvalidParametersError = createErrorClass('InvalidParametersError');
export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');
export const InvalidParametersError = createErrorClass('InvalidParametersError');
/** @deprecated Use InvalidParametersError (fixed spelling). This alias will be removed in a future major release. */
export const InavlidParametersError = InvalidParametersError;
export const ProofSubmissionFailedError = createErrorClass('ProofSubmissionFailedError');
🤖 Prompt for AI Agents
In src/utils/errors.ts around lines 39-40, preserve backward compatibility by
exporting a deprecated alias named InavlidParametersError pointing to the
correctly spelled InvalidParametersError: add a single line that assigns and
exports InavlidParametersError = InvalidParametersError and include a //
deprecated comment referencing the correct name and a TODO to remove in the next
major release; do not change existing imports in src/utils/validationUtils.ts so
current throws keep working.