Closed sidvishnoi closed 2 months ago
Closes https://github.com/interledger/web-monetization-extension/issues/620 Extracted from https://github.com/interledger/web-monetization-extension/pull/619 (check out usage in addPublicKeyToWallet + its handler; also in ConnectWalletForm validation handler)
addPublicKeyToWallet
ConnectWalletForm
ErrorWithKey
Error
errorWithKey
isErrorWithKey
ErrorResponse
failure
{error?: ErrorWithKeyLike}
t
useTranslation
ErrorWithKeyLike
_locales/[lang]/message.json
Context
Closes https://github.com/interledger/web-monetization-extension/issues/620 Extracted from https://github.com/interledger/web-monetization-extension/pull/619 (check out usage in
addPublicKeyToWallet
+ its handler; also inConnectWalletForm
validation handler)Changes proposed in this pull request
ErrorWithKey
(extendsError
; useful for throwing with stack-trace)errorWithKey
(lighter version ofErrorWithKey
; useful when stack-trace not needed)isErrorWithKey
(checks if an object isErrorWithKey
or response oferrorWithKey
)ErrorResponse
andfailure
to have optional{error?: ErrorWithKeyLike}
t
,useTranslation
) to allow convertingErrorWithKeyLike
to string via_locales/[lang]/message.json