Skip to content

Commit

Permalink
fix(GError): fix Error string combination
Browse files Browse the repository at this point in the history
  • Loading branch information
cutedogspark committed Apr 27, 2018
1 parent 6e59660 commit 89b660c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gerr.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ type GError struct {
}

func (g *GError) Error() string {
return fmt.Sprintf("%s", g.Reason)
if g.Err != nil {
return fmt.Sprintf("%s:%s %s, Err:%s", g.Domain, g.Reason, g.Message, g.Err.Error())
}
return fmt.Sprintf("%s:%s %s", g.Domain, g.Reason, g.Message)
}

func (g *GError) AppendDomain(domain string) error {
Expand Down

0 comments on commit 89b660c

Please sign in to comment.