Skip to content

Commit

Permalink
Change type assertion to ClientFacing
Browse files Browse the repository at this point in the history
  • Loading branch information
kisunji committed Apr 8, 2020
1 parent 3b218b1 commit dda92e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func (e *Error) Code() string {
return e.code
}
for err := e.err; err != nil; err = errors.Unwrap(err) {
if e, ok := err.(*Error); ok && e.code != "" {
return e.code
if e, ok := err.(ClientFacing); ok && e.Code() != "" {
return e.Code()
}
}
return ""
Expand All @@ -100,8 +100,8 @@ func (e *Error) Message() string {
return e.message
}
for err := e.err; err != nil; err = errors.Unwrap(err) {
if e, ok := err.(*Error); ok && e.message != "" {
return e.message
if e, ok := err.(ClientFacing); ok && e.Message() != "" {
return e.Message()
}
}
return ""
Expand Down

0 comments on commit dda92e1

Please sign in to comment.