}
catch (const DBus::ErrorException& e)
{
- if (strcmp(e.name(), "error.no_permissions") == 0)
+ if (strcmp(e.name(), "error.unknown_config") == 0)
+ cerr << _("Unknown config.") << endl;
+ else if (strcmp(e.name(), "error.no_permissions") == 0)
cerr << _("No permissions.") << endl;
else if (strcmp(e.name(), "error.invalid_userdata") == 0)
cerr << _("Invalid userdata.") << endl;
}
+struct UnknownConfig : public std::exception
+{
+ explicit UnknownConfig() throw() {}
+ virtual const char* what() const throw() { return "unknown config"; }
+};
+
+
struct Permissions : public std::exception
{
explicit Permissions() throw() {}
if (find(it->users.begin(), it->users.end(), username) != it->users.end())
return;
- break;
+ throw Permissions();
}
}
- throw Permissions();
+ throw UnknownConfig();
}
DBus::MessageError reply(msg, "error.marshalling", DBUS_ERROR_FAILED);
conn.send(reply);
}
+ catch (const UnknownConfig& e)
+ {
+ DBus::MessageError reply(msg, "error.unknown_config", DBUS_ERROR_FAILED);
+ conn.send(reply);
+ }
catch (const Permissions& e)
{
DBus::MessageError reply(msg, "error.no_permissions", DBUS_ERROR_FAILED);