Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log errors with log_error (adapter.c) #84

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions binc/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void binc_internal_adapter_call_method_cb(__attribute__((unused)) GObject
}

if (error != NULL) {
log_debug(TAG, "failed to call adapter method (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to call adapter method (error %d: %s)", error->code, error->message);
g_clear_error(&error);
}
}
Expand Down Expand Up @@ -310,7 +310,7 @@ static void binc_internal_device_disappeared(__attribute__((unused)) GDBusConnec
while (g_variant_iter_loop(interfaces, "s", &interface_name)) {
if (g_str_equal(interface_name, INTERFACE_DEVICE)) {
log_debug(TAG, "Device %s removed", object);

Device *device = g_hash_table_lookup(adapter->devices_cache, object);
if (device != NULL) {
deliver_device_removal(adapter, device);
Expand Down Expand Up @@ -392,7 +392,7 @@ static void binc_internal_device_getall_properties_cb(__attribute__((unused)) GO
GVariant *result = g_dbus_connection_call_finish(binc_device_get_dbus_connection(device), res, &error);

if (error != NULL) {
log_debug(TAG, "failed to call '%s' (error %d: %s)", "GetAll", error->code, error->message);
log_error(TAG, "failed to call '%s' (error %d: %s)", "GetAll", error->code, error->message);
g_clear_error(&error);
}

Expand Down Expand Up @@ -714,7 +714,7 @@ static void binc_internal_start_discovery_cb(__attribute__((unused)) GObject *so
GVariant *value = g_dbus_connection_call_finish(adapter->connection, res, &error);

if (error != NULL) {
log_debug(TAG, "failed to call '%s' (error %d: %s)", METHOD_START_DISCOVERY, error->code, error->message);
log_error(TAG, "failed to call '%s' (error %d: %s)", METHOD_START_DISCOVERY, error->code, error->message);
adapter->discovery_state = BINC_DISCOVERY_STOPPED;
if (adapter->discoveryStateCallback != NULL) {
adapter->discoveryStateCallback(adapter, adapter->discovery_state, error);
Expand Down Expand Up @@ -759,7 +759,7 @@ static void binc_internal_stop_discovery_cb(__attribute__((unused)) GObject *sou
GVariant *value = g_dbus_connection_call_finish(adapter->connection, res, &error);

if (error != NULL) {
log_debug(TAG, "failed to call '%s' (error %d: %s)", METHOD_STOP_DISCOVERY, error->code, error->message);
log_error(TAG, "failed to call '%s' (error %d: %s)", METHOD_STOP_DISCOVERY, error->code, error->message);
if (adapter->discoveryStateCallback != NULL) {
adapter->discoveryStateCallback(adapter, adapter->discovery_state, error);
}
Expand Down Expand Up @@ -878,7 +878,7 @@ static void binc_internal_set_property_cb(__attribute__((unused)) GObject *sourc
}

if (error != NULL) {
log_debug(TAG, "failed to set adapter property (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to set adapter property (error %d: %s)", error->code, error->message);
g_clear_error(&error);
}
}
Expand Down Expand Up @@ -1020,7 +1020,7 @@ static void binc_internal_start_advertising_cb(__attribute__((unused)) GObject *
}

if (error != NULL) {
log_debug(TAG, "failed to register advertisement (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to register advertisement (error %d: %s)", error->code, error->message);
g_clear_error(&error);
} else {
log_debug(TAG, "started advertising (%s)", adapter->address);
Expand Down Expand Up @@ -1061,7 +1061,7 @@ static void binc_internal_stop_advertising_cb(__attribute__((unused)) GObject *s
}

if (error != NULL) {
log_debug(TAG, "failed to unregister advertisement (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to unregister advertisement (error %d: %s)", error->code, error->message);
g_clear_error(&error);
} else {
binc_advertisement_unregister(adapter->advertisement, adapter);
Expand Down Expand Up @@ -1100,7 +1100,7 @@ static void binc_internal_register_appl_cb(__attribute__((unused)) GObject *sour
}

if (error != NULL) {
log_debug(TAG, "failed to register application (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to register application (error %d: %s)", error->code, error->message);
g_clear_error(&error);
} else {
log_debug(TAG, "successfully registered application");
Expand Down Expand Up @@ -1139,7 +1139,7 @@ static void binc_internal_unregister_appl_cb(__attribute__((unused)) GObject *so
}

if (error != NULL) {
log_debug(TAG, "failed to unregister application (error %d: %s)", error->code, error->message);
log_error(TAG, "failed to unregister application (error %d: %s)", error->code, error->message);
g_clear_error(&error);
} else {
log_debug(TAG, "successfully unregistered application");
Expand Down
Loading