Skip to content

Enhance FieldError with code and suggestion properties#545

Merged
Justintime50 merged 6 commits intoEasyPost:masterfrom
vCiKv:master
Mar 3, 2026
Merged

Enhance FieldError with code and suggestion properties#545
Justintime50 merged 6 commits intoEasyPost:masterfrom
vCiKv:master

Conversation

@vCiKv
Copy link
Contributor

@vCiKv vCiKv commented Feb 28, 2026

Description

Adds IAddressVerificationFieldError interface and replaces the errors key of Verification with it as it's the proper type. Adds missing suggestion to IFieldError

Testing

Just added optional types

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

Added optional 'code' and 'suggestion' properties to FieldError.
@vCiKv vCiKv requested review from a team as code owners February 28, 2026 14:14
Copy link
Member

@Justintime50 Justintime50 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I think what I'd like to see here instead is the introduction of the AddressVerificationFieldError class (which has a code) since FieldError does not.

See https://docs.easypost.com/docs/errors and another related PR EasyPost/easypost-php@e9ed0f6 for more details. Ultimately it looks like we didn't properly port those changes here when we did them so thanks for helping fill this gap!

vCiKv and others added 5 commits March 2, 2026 22:36
Introduce IAddressVerificationFieldError and Update IVerification to use the new address-specific error type. Simplify IFieldError
Update the JSDoc for IAddressVerificationFieldError.field to correctly state it's description
Copy link
Member

@Justintime50 Justintime50 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@Justintime50 Justintime50 merged commit 404f0e8 into EasyPost:master Mar 3, 2026
15 checks passed
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