catch (const DBus::ErrorException& e)
{
if (strcmp(e.name(), "error.no_permissions") == 0)
- cerr << "failed (no permissions)" << endl;
+ cerr << _("No permissions.") << endl;
+ else if (strcmp(e.name(), "error.invalid_userdata") == 0)
+ cerr << _("Invalid userdata.") << endl;
else
- cerr << "failed (" << e.what() << ")" << endl;
+ cerr << _("Failure") << " (" << e.what() << ")." << endl;
}
catch (const DBus::FatalException& e)
{
- cerr << "failed (" << e.what() << ")" << endl;
+ cerr << _("Failure") << " (" << e.what() << ")." << endl;
}
exit(EXIT_SUCCESS);
struct ErrorException : public Exception
{
explicit ErrorException(const DBusError err) throw() : err(err) {}
- ~ErrorException() throw() { dbus_error_free(&err); }
+ virtual ~ErrorException() throw() { dbus_error_free(&err); }
virtual const char* what() const throw() { return "dbus error exception"; }
virtual const char* name() const throw() { return err.name; }
virtual const char* message() const throw() { return err.message; }
DBus::MessageError reply(msg, "error.illegal_snapshot", DBUS_ERROR_FAILED);
conn.send(reply);
}
+ catch (const InvalidUserdataException& e)
+ {
+ DBus::MessageError reply(msg, "error.invalid_userdata", DBUS_ERROR_FAILED);
+ conn.send(reply);
+ }
catch (...)
{
DBus::MessageError reply(msg, "error.something", DBUS_ERROR_FAILED);