}
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
- GST_DEBUG_OBJECT (self, "Connection was cancelled (%s)",
- GST_STR_NULL (error->message));
+ GST_DEBUG_OBJECT (self, "Connection was cancelled: %s", error->message);
return;
}
- GST_ERROR_OBJECT (self, "Failed to connect (%s:%d): %s",
- g_quark_to_string (error->domain), error->code,
- GST_STR_NULL (error->message));
+ GST_ERROR_OBJECT (self, "Failed to connect: %s %d %s",
+ g_quark_to_string (error->domain), error->code, error->message);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED)) {
GST_ELEMENT_ERROR (self, RESOURCE, NOT_AUTHORIZED,
- ("Not authorized to connect"), ("%s", GST_STR_NULL (error->message)));
+ ("Not authorized to connect: %s", error->message), (NULL));
} else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED)) {
GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ,
- ("Could not connect"), ("%s", GST_STR_NULL (error->message)));
+ ("Connection refused: %s", error->message), (NULL));
} else {
GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
- ("Failed to connect"),
- ("error %s:%d: %s", g_quark_to_string (error->domain), error->code,
- GST_STR_NULL (error->message)));
+ ("Failed to connect: %s", error->message),
+ ("domain %s, code %d", g_quark_to_string (error->domain), error->code));
}
}
}
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
- GST_DEBUG_OBJECT (self, "Connection was cancelled (%s)",
- GST_STR_NULL (error->message));
+ GST_DEBUG_OBJECT (self, "Connection was cancelled: %s", error->message);
return;
}
- GST_ERROR_OBJECT (self, "Failed to connect (%s:%d): %s",
- g_quark_to_string (error->domain), error->code,
- GST_STR_NULL (error->message));
+ GST_ERROR_OBJECT (self, "Failed to connect: %s %d %s",
+ g_quark_to_string (error->domain), error->code, error->message);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED)) {
GST_ELEMENT_ERROR (self, RESOURCE, NOT_AUTHORIZED,
- ("Not authorized to connect"), ("%s", GST_STR_NULL (error->message)));
+ ("Not authorized to connect: %s", error->message), (NULL));
} else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED)) {
GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ,
- ("Could not connect"), ("%s", GST_STR_NULL (error->message)));
+ ("Connection refused: %s", error->message), (NULL));
} else {
GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
- ("Failed to connect"),
- ("error %s:%d: %s", g_quark_to_string (error->domain), error->code,
- GST_STR_NULL (error->message)));
+ ("Failed to connect: %s", error->message),
+ ("domain %s, code %d", g_quark_to_string (error->domain), error->code));
}
}
if (!args) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "connect failed: %s", command_name);
+ "'connect' cmd failed: %s", command_name);
g_object_unref (task);
return;
}
if (args->len < 2) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "connect failed; not enough return arguments");
+ "'connect' cmd failed; not enough return arguments");
g_object_unref (task);
return;
}
code = node ? gst_amf_node_peek_string (node, NULL) : NULL;
if (!code) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "result code missing from connect cmd result");
+ "'connect' cmd failed; no status code");
g_object_unref (task);
return;
}
desc = node ? gst_amf_node_peek_string (node, NULL) : NULL;
if (!desc) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "Connect rejected; no description");
+ "'connect' cmd returned '%s'; no description", code);
g_object_unref (task);
return;
}
}
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "unhandled authentication mode: %s", desc);
+ "'connect' cmd returned unhandled authmod: %s", desc);
g_object_unref (task);
return;
}
if (!g_regex_match (auth_regex, desc, 0, &match_info)) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "failed to parse auth rejection: %s", desc);
+ "'connect' cmd returned '%s': %s", code, desc);
g_object_unref (task);
return;
}
if (g_str_equal (reason, "authfailed")) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "authentication failed! wrong credentials?");
+ "authentication failed; wrong credentials?: %s", desc);
g_object_unref (task);
gst_uri_unref (query);
return;
if (!g_str_equal (reason, "needauth")) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "unhandled rejection reason '%s'", reason);
+ "authentication failed; reason '%s': %s", reason, desc);
g_object_unref (task);
gst_uri_unref (query);
return;
* and password are provided */
g_warn_if_reached ();
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "couldn't generate adobe style authentication query");
+ "internal error: failed to generate adobe auth query");
g_object_unref (task);
return;
}
}
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "unhandled connect result code: %s", code);
+ "'connect' cmd returned '%s'", code);
g_object_unref (task);
}
if (!data->location.secure_token || !data->location.secure_token[0]) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
- "server requires secure token authentication");
+ "server requires secureToken but no token provided");
g_object_unref (task);
return;
}
if (!args) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "createStream failed: %s", command_name);
+ "'createStream' cmd failed: %s", command_name);
g_object_unref (task);
return;
}
if (args->len < 2) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "createStream failed; not enough return arguments");
+ "'createStream' cmd failed; not enough return arguments");
g_object_unref (task);
return;
}
gst_amf_node_dump (result, -1, error_dump);
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "createStream failed: %s", error_dump->str);
+ "'createStream' cmd failed: %s: %s", command_name, error_dump->str);
g_object_unref (task);
g_string_free (error_dump, TRUE);
if (data->id == 0) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
- "createStream returned ID 0");
+ "'createStream' cmd returned ID 0");
g_object_unref (task);
return;
}
if (!args) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s failed: %s", command, command_name);
+ "'%s' cmd failed: %s", command, command_name);
g_object_unref (task);
return;
}
if (args->len < 2) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "%s failed; not enough return arguments", command);
+ "'%s' cmd failed; not enough return arguments", command);
g_object_unref (task);
return;
}
if (g_strcmp0 (code, "NetStream.Publish.BadName") == 0) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_EXISTS,
- "publish denied: stream already exists: %s", info_dump->str);
+ "publish denied; stream already exists: %s", info_dump->str);
goto out;
}
if (g_strcmp0 (code, "NetStream.Play.StreamNotFound") == 0) {
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
- "play denied: stream not found: %s", info_dump->str);
+ "play denied; stream not found: %s", info_dump->str);
goto out;
}
}
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- "unhandled %s result: %s", command, info_dump->str);
+ "'%s' cmd failed: %s: %s", command, command_name, info_dump->str);
out:
g_string_free (info_dump, TRUE);