protected virtual void parse_args () throws Error {
int64 index, requested_count;
+
+ // Browse and Search action must have 6 mandatory arguments
+ if (action.get_argument_count () != 6) {
+ throw new ContentDirectoryError.INVALID_ARGS
+ (_("Invalid number of arguments"));
+ }
+
this.action.get (this.object_id_arg,
typeof (string),
out this.object_id,
var media_object = yield this.root_container.find_object
(this.object_id, this.cancellable);
if (media_object == null) {
- throw new ContentDirectoryError.NO_SUCH_OBJECT
- (_("No such object"));
+ if (this.object_id_arg == "ObjectID"){
+ throw new ContentDirectoryError.NO_SUCH_OBJECT
+ (_("No such object"));
+ }else{
+ throw new ContentDirectoryError.NO_SUCH_CONTAINER
+ (_("No such container"));
+ }
}
debug ("object '%s' found.", this.object_id);
yield parser.run ();
if (parser.err != null) {
- throw parser.err;
+ throw new ContentDirectoryError.INVALID_SEARCH_CRITERIA
+ ("Invalid search criteria given");
}
var sort_criteria = this.sort_criteria ?? container.sort_criteria;