Skip to content

Commit 191a72b

Browse files
committed
Expose the real error message of NotFound error
This change exposes the error message of NotFound error from openstack API, this is helpful to find out the reason of request failure.
1 parent 3b820fa commit 191a72b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

errors.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ func (e ErrDefault403) Error() string {
179179
return e.choseErrString()
180180
}
181181
func (e ErrDefault404) Error() string {
182-
return "Resource not found"
182+
e.DefaultErrString = fmt.Sprintf(
183+
"Resource not found: [%s %s], error message: %s",
184+
e.Method, e.URL, e.Body,
185+
)
186+
return e.choseErrString()
183187
}
184188
func (e ErrDefault405) Error() string {
185189
return "Method not allowed"

0 commit comments

Comments
 (0)