Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
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
Show warning if method response errors occur and error not handled.
  • Loading branch information
robert-ancell committed Jun 9, 2020
commit c5806a8468e8f89e2c2b83cb924a81bea45c7194
18 changes: 16 additions & 2 deletions shell/platform/linux/fl_method_call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,22 @@ G_MODULE_EXPORT gboolean fl_method_call_respond(FlMethodCall* self,
GError** error) {
g_return_val_if_fail(FL_IS_METHOD_CALL(self), FALSE);
g_return_val_if_fail(FL_IS_METHOD_RESPONSE(response), FALSE);
return fl_method_channel_respond(self->channel, self->response_handle,
response, error);

g_autoptr(GError) local_error = nullptr;
if (!fl_method_channel_respond(self->channel, self->response_handle, response,
&local_error)) {
// If the developer chose not to handle the error then log it so it's not
// missed.
if (error == nullptr) {
g_warning("Failed to send method call response: %s",
local_error->message);
}

g_propagate_error(error, local_error);
return FALSE;
}

return TRUE;
}

G_MODULE_EXPORT gboolean fl_method_call_respond_success(FlMethodCall* self,
Expand Down