Skip to content

Commit

Permalink
feat(errors): add StringPtr function to ErrorDetailCode
Browse files Browse the repository at this point in the history
  • Loading branch information
bradub committed Jan 17, 2025
1 parent fee52d2 commit e1bfe26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions errors/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ func IsErrorCode(err error, code ErrorCode) bool {
// ErrorDetailCode contains additional specific codes to provide context to the error.
type ErrorDetailCode string

func (c ErrorDetailCode) String() string { return string(c) }

// StringPtr returns the ErrorDetailCode as a string pointer.
func (c ErrorDetailCode) StringPtr() *string { p := string(c); return &p }

// ErrorDetail provides explicit details on an Error.
type ErrorDetail struct {
Code ErrorDetailCode
Expand Down

0 comments on commit e1bfe26

Please sign in to comment.