[rygel/rygel-0-18] server: Fix UPnP Error codes



commit 72e20ebe8b9b2f9299d7226751f0a740564bca44
Author: Parthiban Balasubramanian <p balasubramanian cablelabs com>
Date:   Wed Jun 12 14:57:01 2013 -0600

    server: Fix UPnP Error codes
    
    CreateObject, UpdateObject and DestroyObject UPnP Actions were using
    slightly wrong error codes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703140
    
    Conflicts:
        src/librygel-server/rygel-object-creator.vala

 src/librygel-server/rygel-item-destroyer.vala |    4 ++--
 src/librygel-server/rygel-item-updater.vala   |    4 ++--
 src/librygel-server/rygel-object-creator.vala |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/librygel-server/rygel-item-destroyer.vala b/src/librygel-server/rygel-item-destroyer.vala
index 3c960a6..ba42f2e 100644
--- a/src/librygel-server/rygel-item-destroyer.vala
+++ b/src/librygel-server/rygel-item-destroyer.vala
@@ -49,8 +49,8 @@ internal class Rygel.ItemDestroyer: GLib.Object, Rygel.StateMachine {
             this.action.get ("ObjectID", typeof (string), out this.object_id);
             if (this.object_id == null) {
                 // Sorry we can't do anything without the ID
-                throw new ContentDirectoryError.NO_SUCH_OBJECT
-                                        (_("No such object"));
+                throw new ContentDirectoryError.INVALID_ARGS
+                                        (_("ContainerID missing"));
             }
 
             yield this.remove_object ();
diff --git a/src/librygel-server/rygel-item-updater.vala b/src/librygel-server/rygel-item-updater.vala
index 6eba9a0..9f1870e 100644
--- a/src/librygel-server/rygel-item-updater.vala
+++ b/src/librygel-server/rygel-item-updater.vala
@@ -66,8 +66,8 @@ internal class Rygel.ItemUpdater: GLib.Object, Rygel.StateMachine {
                                  out this.new_tag_value);
             if (this.object_id == null) {
                 // Sorry we can't do anything without the ID
-                throw new ContentDirectoryError.NO_SUCH_OBJECT
-                                        (_("No such object"));
+                throw new ContentDirectoryError.INVALID_ARGS
+                                        (_("Object id missing"));
             }
 
             yield this.update_object ();
diff --git a/src/librygel-server/rygel-object-creator.vala b/src/librygel-server/rygel-object-creator.vala
index 74bb0f2..541d2e8 100644
--- a/src/librygel-server/rygel-object-creator.vala
+++ b/src/librygel-server/rygel-object-creator.vala
@@ -255,7 +255,7 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
         }
 
         if (didl_object.restricted) {
-            throw new ContentDirectoryError.INVALID_ARGS
+            throw new ContentDirectoryError.BAD_METADATA
                                         ("Cannot create restricted item");
         }
     }
@@ -350,8 +350,8 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
         }
 
         if (media_object == null || !(media_object is MediaContainer)) {
-            throw new ContentDirectoryError.NO_SUCH_OBJECT
-                                        (_("No such object"));
+            throw new ContentDirectoryError.NO_SUCH_CONTAINER
+                                        (_("No such container"));
         } else if (!(OCMFlags.UPLOAD in media_object.ocm_flags) ||
                    !(media_object is WritableContainer)) {
             throw new ContentDirectoryError.RESTRICTED_PARENT


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]