Report error when core download failed (#14824)

Fix curly bracket opening
This commit is contained in:
gouchi 2023-01-08 19:32:47 +01:00 committed by GitHub
parent af9f946019
commit ec2805a562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,7 @@ enum core_updater_download_status
CORE_UPDATER_DOWNLOAD_START_TRANSFER, CORE_UPDATER_DOWNLOAD_START_TRANSFER,
CORE_UPDATER_DOWNLOAD_WAIT_TRANSFER, CORE_UPDATER_DOWNLOAD_WAIT_TRANSFER,
CORE_UPDATER_DOWNLOAD_WAIT_DECOMPRESS, CORE_UPDATER_DOWNLOAD_WAIT_DECOMPRESS,
CORE_UPDATER_DOWNLOAD_ERROR,
CORE_UPDATER_DOWNLOAD_END CORE_UPDATER_DOWNLOAD_END
}; };
@ -633,9 +634,11 @@ void cb_http_task_core_updater_download(
finish: finish:
/* Log any error messages */ /* Log any error messages */
if (!string_is_empty(err)) if (!string_is_empty(err))
{
RARCH_ERR("[core updater] Download of '%s' failed: %s\n", RARCH_ERR("[core updater] Download of '%s' failed: %s\n",
(transf ? transf->path: "unknown"), err); (transf ? transf->path: "unknown"), err);
download_handle->status = CORE_UPDATER_DOWNLOAD_ERROR;
}
if (transf) if (transf)
free(transf); free(transf);
@ -923,6 +926,21 @@ static void task_core_updater_download_handler(retro_task_t *task)
download_handle->status = CORE_UPDATER_DOWNLOAD_END; download_handle->status = CORE_UPDATER_DOWNLOAD_END;
} }
break; break;
case CORE_UPDATER_DOWNLOAD_ERROR:
{
char task_title[PATH_MAX_LENGTH];
/* Set final task title */
task_free_title(task);
strlcpy(task_title, msg_hash_to_str(MSG_CORE_INSTALL_FAILED), sizeof(task_title));
strlcat(task_title, download_handle->display_name, sizeof(task_title));
task_set_title(task, strdup(task_title));
task_set_progress(task, 100);
goto task_finished;
}
break;
case CORE_UPDATER_DOWNLOAD_END: case CORE_UPDATER_DOWNLOAD_END:
{ {
char task_title[PATH_MAX_LENGTH]; char task_title[PATH_MAX_LENGTH];