Skip to content

Enhance FieldError with code and suggestion properties#545

Open
vCiKv wants to merge 2 commits intoEasyPost:masterfrom
vCiKv:master
Open

Enhance FieldError with code and suggestion properties#545
vCiKv wants to merge 2 commits intoEasyPost:masterfrom
vCiKv:master

Conversation

@vCiKv
Copy link

@vCiKv vCiKv commented Feb 28, 2026

Added optional 'code' and 'suggestion' properties to FieldError.

Description

Added Extra types to FieldError to prevent TS error when accessing types

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!

* Human readable description of the problem
*/
message: string;
/**
Copy link
Member

Choose a reason for hiding this comment

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

please include line breaks between each new entry

Introduce IAddressVerificationFieldError and Update IVerification to use the new address-specific error type. Simplify IFieldError
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