-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: payment detection error does not throw (#163)
- Loading branch information
Showing
13 changed files
with
317 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { PaymentTypes } from '@requestnetwork/types'; | ||
|
||
/** | ||
* Creates the object IBalanceWithEvents from the error code and error message | ||
* | ||
* @param message error message | ||
* @param code error code | ||
* @returns The object IBalanceWithEvents to return | ||
*/ | ||
export default function getBalanceErrorObject( | ||
message: string, | ||
code?: PaymentTypes.BALANCE_ERROR_CODE, | ||
): PaymentTypes.IBalanceWithEvents { | ||
return { | ||
balance: null, | ||
error: { | ||
code: code || PaymentTypes.BALANCE_ERROR_CODE.UNKNOWN, | ||
message, | ||
}, | ||
events: [], | ||
}; | ||
} |
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
Oops, something went wrong.