aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--errors.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/errors.go b/errors.go
index 7a7d40d..8e3eef6 100644
--- a/errors.go
+++ b/errors.go
@@ -62,13 +62,15 @@ func (e UnexpectedStatusCodeError) Error() string {
//Is checks if the given error is an UnexpectedStatusCodeError for that status
//code. For example:
//
-// info, err := container.Info()
-// if schwift.Is(err, http.StatusNotFound) {
-// // ... create container ...
-// } else if err != nil {
-// // ... report error ...
-// } else {
-// // ... use container info ...
+// err := container.Delete(nil, nil)
+// if err != nil {
+// if schwift.Is(err, http.StatusNotFound) {
+// //container does not exist -> just what we wanted
+// return nil
+// } else {
+// //report unexpected error
+// return err
+// }
// }
func Is(err error, code int) bool {
if e, ok := err.(UnexpectedStatusCodeError); ok {