} catch (const std::exception& ex) {
LOGE("Logic exception while copying skel into temporary dir [session_uid=%d subsession_id=%s]: %s", session_uid, subsession_id.data(), ex.what());
backend.AddSubsessionCleanupFailure(tmp_subsession_path, subsession_path);
+ throw;
}
}
catch (std::system_error const &ex) {
return;
}
- do_add_user(session_uid, subsession_id, DirBackendAddRegularDir {});
+ try {
+ do_add_user(session_uid, subsession_id, DirBackendAddRegularDir {});
+ } catch (const std::exception &ex) {
+ g_dbus_method_invocation_return_dbus_error(invocation,
+ get_dbus_error_mapping(SUBSESSION_ERROR_IO_ERROR), "Failed to add subsession");
+ return;
+ }
g_dbus_method_invocation_return_value(invocation, nullptr);
}
return;
}
- do_add_user(session_uid, subsession_id, DirBackendAddFixedSize {size_kB});
+ try {
+ do_add_user(session_uid, subsession_id, DirBackendAddFixedSize {size_kB});
+ } catch (const std::exception &ex) {
+ g_dbus_method_invocation_return_dbus_error(invocation,
+ get_dbus_error_mapping(SUBSESSION_ERROR_IO_ERROR), "Failed to add subsession");
+ return;
+ }
g_dbus_method_invocation_return_value(invocation, nullptr);
}
return;
}
- do_remove_user(session_uid, subsession_id);
+ try {
+ do_remove_user(session_uid, subsession_id);
+ } catch (const std::exception &ex) {
+ g_dbus_method_invocation_return_dbus_error(invocation,
+ get_dbus_error_mapping(SUBSESSION_ERROR_IO_ERROR), "Failed to remove subsession");
+ return;
+ }
g_dbus_method_invocation_return_value(invocation, nullptr);
}