#define SYNC_MANAGER_DBUS_PATH "/org/tizen/sync/manager"
#define SYNC_ADAPTER_DBUS_PATH "/org/tizen/sync/adapter"
#define SYNC_ERROR_PREFIX "org.tizen.sync.Error"
+#define FREEDEKTOP_ERROR_PREFIX "org.freedesktop.DBus.Error"
#include <system_info.h>
gchar *remote_error = g_dbus_error_get_remote_error(error);
if (remote_error) {
LOG_LOGD("Remote error [%s]", remote_error);
- int error_enum_count = G_N_ELEMENTS(_sync_errors);
- int i = 0;
- for (i = 0; i < error_enum_count; i++) {
- if (g_strcmp0(_sync_errors[i].dbus_error_name, remote_error) == 0) {
- LOG_LOGD("Remote error code matched [%d]", _sync_errors[i].error_code);
+ if (g_str_has_prefix(remote_error, SYNC_ERROR_PREFIX) == true) {
+ int error_enum_count = G_N_ELEMENTS(_sync_errors);
+ for (int i = 0; i < error_enum_count; i++) {
+ if (g_strcmp0(_sync_errors[i].dbus_error_name, remote_error) == 0) {
+ LOG_LOGD("Remote error code matched [%d]", _sync_errors[i].error_code);
+ g_free(remote_error);
+ remote_error = NULL;
+ return _sync_errors[i].error_code;
+ }
+ }
+ } else if (g_str_has_prefix(remote_error, FREEDEKTOP_ERROR_PREFIX) == true) {
+ const char* error_name = FREEDEKTOP_ERROR_PREFIX".AccessDenied";
+ if (g_strcmp0(error_name, remote_error) == 0) {
+ LOG_LOGD("Error code matched with freedesktop error");
g_free(remote_error);
remote_error = NULL;
- return _sync_errors[i].error_code;
+ return SYNC_ERROR_PERMISSION_DENIED;
}
}
}