-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: integrate new error handling in RLP
- Loading branch information
1 parent
7e85324
commit ee91b9c
Showing
7 changed files
with
104 additions
and
176 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { ERRORS } from '../../../utils'; | ||
import { buildError, type ErrorType, RLP } from '@vechain-sdk/errors'; | ||
|
||
/** | ||
* Create a context-aware RLP error. | ||
* @param context - Contextual information for enhanced error detail. | ||
* @param message - Descriptive error message. | ||
* @returns An Error object tailored for RLP issues. | ||
*/ | ||
const createRlpError = (context: string, message: string): Error => { | ||
return new Error(ERRORS.RLP.INVALID_RLP(context, message)); | ||
const createRlpError = ( | ||
context: string, | ||
message: string | ||
): ErrorType<RLP.INVALID_RLP> => { | ||
return buildError(RLP.INVALID_RLP, message, { context }); | ||
}; | ||
|
||
export { createRlpError }; |
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.