feat: add verbose error messaging (#3053)

This commit is contained in:
Jon Ayers
2022-07-20 15:17:51 -05:00
committed by GitHub
parent 4a7d067c6c
commit 62e685669f
5 changed files with 170 additions and 15 deletions

View File

@ -185,6 +185,10 @@ func (e *Error) StatusCode() int {
return e.statusCode
}
func (e *Error) Friendly() string {
return fmt.Sprintf("%s. %s", strings.TrimSuffix(e.Message, "."), e.Helper)
}
func (e *Error) Error() string {
var builder strings.Builder
if e.method != "" && e.url != "" {