-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(backend): estimate ILP quote receive amount, and fail early (#2783
) * chore(backend): check for estimated receive amount when getting an ilp quote * chore(backend): handle ilp quoting error during quote creation * chore(backend): updating error handling
- Loading branch information
Showing
7 changed files
with
133 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
interface ErrorDetails { | ||
description: string | ||
retryable?: boolean | ||
code?: PaymentMethodHandlerErrorCode | ||
} | ||
|
||
export enum PaymentMethodHandlerErrorCode { | ||
QuoteNonPositiveReceiveAmount = 'QuoteNonPositiveReceiveAmount' | ||
} | ||
|
||
export class PaymentMethodHandlerError extends Error { | ||
public description: string | ||
public retryable?: boolean | ||
public code?: PaymentMethodHandlerErrorCode | ||
|
||
constructor(message: string, args: ErrorDetails) { | ||
super(message) | ||
this.name = 'PaymentMethodHandlerError' | ||
this.description = args.description | ||
this.retryable = args.retryable | ||
this.code = args.code | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters