--- a/gondole.go Thu Apr 13 00:17:57 2017 +0200
+++ b/gondole.go Thu Apr 13 09:30:47 2017 +0200
@@ -19,8 +19,10 @@
NoRedirect = "urn:ietf:wg:oauth:2.0:oob"
)
+// Error codes
var (
- ErrAlreadyRegistered = errors.New("App already registered")
+ ErrAlreadyRegistered = errors.New("app already registered")
+ ErrEntityNotFound = errors.New("entity not found")
)
// prepareRequest insert all pre-defined stuff
--- a/notifications.go Thu Apr 13 00:17:57 2017 +0200
+++ b/notifications.go Thu Apr 13 09:30:47 2017 +0200
@@ -51,6 +51,10 @@
return ¬ification, fmt.Errorf("notification API: %s", err.Error())
}
+ if notification.ID == 0 {
+ return nil, ErrEntityNotFound
+ }
+
return ¬ification, nil
}