{
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return true;
}
if (subsession_id <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative subsession_id passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative subsession_id passed");
return true;
}
current_subsession_id = last_subsession_per_session.at(session_uid);
if (subsession_id == current_subsession_id) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_RESOURCE_BUSY].second.data(), "Cannot remove currently active user");
+ sessiond_errors[DBUS_ERROR_RESOURCE_BUSY].second.data(), "Cannot remove currently active user");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
// N.B. Switch to user '0' is possible and it means no subsession is currently active
if (next_subsession_id < 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative subsession_id passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative subsession_id passed");
return;
}
if (next_subsession_id > 0 && !fs_helpers::subsession_exists(session_uid, next_subsession_id)) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_DOES_NOT_EXIST].second.data(), "Subsession does not exist");
+ sessiond_errors[DBUS_ERROR_NOT_AVAILABLE].second.data(), "Subsession does not exist");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
if (session_uid <= 0) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), "Negative UID passed");
return;
}
(self->*(to_call->second))(invocation, std::string_view(sender), parameters);
} catch (const std::invalid_argument &ex) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_INVALID_PARAMETER].second.data(), ex.what());
+ sessiond_errors[DBUS_ERROR_INVALID_PARAMETER].second.data(), ex.what());
log_exception(ex, sender, method_name);
} catch (const std::system_error &ex) {
switch (ex.code().value()) {
case EEXIST:
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_ALREADY_EXISTS].second.data(), ex.what());
+ sessiond_errors[DBUS_ERROR_ALREADY_EXISTS].second.data(), ex.what());
break;
case ENOENT:
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_DOES_NOT_EXIST].second.data(), ex.what());
+ sessiond_errors[DBUS_ERROR_NOT_AVAILABLE].second.data(), ex.what());
break;
default:
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_IO_ERROR].second.data(),
+ sessiond_errors[DBUS_ERROR_IO_ERROR].second.data(),
(std::string("Unable to complete requested operation: ") + ex.what()).c_str());
break;
}
log_exception(ex, sender, method_name);
} catch (const std::runtime_error &ex) {
g_dbus_method_invocation_return_dbus_error(invocation,
- sessiond_errors[SUBSESSION_ERROR_IO_ERROR].second.data(),
+ sessiond_errors[DBUS_ERROR_IO_ERROR].second.data(),
(std::string("Unable to complete requested operation: ") + ex.what()).c_str());
log_exception(ex, sender, method_name);
// Swallow the exception; the show must go on
};
enum {
- SUBSESSION_ERROR_INVALID_PARAMETER,
- SUBSESSION_ERROR_IO_ERROR,
- SUBSESSION_ERROR_ALREADY_EXISTS,
- SUBSESSION_ERROR_DOES_NOT_EXIST,
- SUBSESSION_ERROR_RESOURCE_BUSY,
+ DBUS_ERROR_INVALID_PARAMETER,
+ DBUS_ERROR_IO_ERROR,
+ DBUS_ERROR_ALREADY_EXISTS,
+ DBUS_ERROR_NOT_AVAILABLE,
+ DBUS_ERROR_RESOURCE_BUSY,
};
constexpr static std::array sessiond_errors = {
- std::make_pair(SUBSESSION_ERROR_INVALID_PARAMETER, "org.tizen.sessiond.Error.InvalidParameter"sv),
- std::make_pair(SUBSESSION_ERROR_IO_ERROR, "org.tizen.sessiond.Error.IOError"sv),
- std::make_pair(SUBSESSION_ERROR_ALREADY_EXISTS, "org.tizen.sessiond.Error.SubsessionAlreadyExists"sv),
- std::make_pair(SUBSESSION_ERROR_DOES_NOT_EXIST, "org.tizen.sessiond.Error.SubsessionDoesNotExist"sv),
- std::make_pair(SUBSESSION_ERROR_RESOURCE_BUSY, "org.tizen.sessiond.Error.UserIsActive"sv),
+ std::make_pair(DBUS_ERROR_INVALID_PARAMETER, "org.tizen.sessiond.Error.InvalidParameter"sv),
+ std::make_pair(DBUS_ERROR_IO_ERROR, "org.tizen.sessiond.Error.IOError"sv),
+ std::make_pair(DBUS_ERROR_ALREADY_EXISTS, "org.tizen.sessiond.Error.SubsessionAlreadyExists"sv),
+ std::make_pair(DBUS_ERROR_NOT_AVAILABLE, "org.tizen.sessiond.Error.SubsessionDoesNotExist"sv),
+ std::make_pair(DBUS_ERROR_RESOURCE_BUSY, "org.tizen.sessiond.Error.UserIsActive"sv),
};
// TODO: Currently, the first parameter is always a single-element tuple.