Open dmmulroy opened 1 month ago
Latest commit: 72e0a7ca0f37d2d685efd5d8117f1815a0311afd
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@supermacro rebased on to master
and added a changeset. This is the same work as #558
safe to close this, right?
Ope yup sorry, this notification got buried - will update tomorrow!
Pull Request Description
Summary
This PR introduces enhancements to the error handling mechanism within the codebase by allowing custom error messages to be specified. Additionally, it updates the README documentation and adds new test cases.
Changes Made
README.md:
src/_internals/error.ts
:ErrorConfig
interface to include an optionalmessage
property.src/result.ts
:_unsafeUnwrapErr
method in theOk
class to use the custom error message if provided, otherwise, it defaults to the existing message._unsafeUnwrap
method in theErr
class to use the custom error message if provided, otherwise, it defaults to the existing message.tests/index.test.ts
:_unsafeUnwrap
and_unsafeUnwrapErr
are called with a custom message in theOk
andErr
classes.