feat: replace @hapi/boom with built-in HipError class#96
Open
Sarita-Joshi wants to merge 1 commit intotrycatchal:masterfrom
Open
feat: replace @hapi/boom with built-in HipError class#96Sarita-Joshi wants to merge 1 commit intotrycatchal:masterfrom
Sarita-Joshi wants to merge 1 commit intotrycatchal:masterfrom
Conversation
Removes the @hapi/boom dependency entirely and replaces it with a lightweight HipError class defined in core.ts. This gives hipthrusts its own error type with no external dependencies, making it simpler for consumers (no need to import or know about boom). HipError has statusCode, message, and a static isHipError() type guard. Adapters catch HipError directly instead of checking Boom.isBoom(). BREAKING CHANGE: Consumers that caught Boom errors from hipthrusts should now catch HipError instead. The .output property is preserved for backwards compatibility with existing adapter code.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
@hapi/boomas a dependency entirely and replaces it with a lightweightHipErrorclass incore.ts.HipError(statusCode, message)replaces allBoom.xxx()callsHipError.isHipError()replacesBoom.isBoom()checks.outputproperty preserved for backwards compatibility with existing adapterscore.ts,mongoose.ts,zod.ts, andpackage.jsonBREAKING CHANGE: Consumers catching Boom errors should catch
HipErrorinstead.