void InitVirtualDriveDialog::onCreateDefaultRepoFailure(const ApiError& error) { if (error.type() == ApiError::HTTP_ERROR && error.httpErrorCode() == 404) { fail(tr("Failed to create default library:\n\n" "The server version must be 2.1 or higher to support this.")); } else { fail(tr("Failed to create default library:\n%1").arg(error.toString())); } }
void FileNetworkTask::onGetLinkFailed(const ApiError& error) { error_ = ApiRequestError; error_string_ = error.toString(); if (error.type() == ApiError::HTTP_ERROR) { http_error_code_ = error.httpErrorCode(); } onFinished(false); }
void ActivitiesTab::refreshFailed(const ApiError& error) { QString text; if (error.type() == ApiError::HTTP_ERROR && error.httpErrorCode() == 404) { text = tr("File Activities are only supported in Seafile Server Professional Edition."); } else { QString link = QString("<a style=\"color:#777\" href=\"#\">%1</a>").arg(tr("retry")); text = tr("Failed to get actvities information. " "Please %1").arg(link); } loading_failed_text_->setText(text); mStack->setCurrentIndex(INDEX_LOADING_FAILED_VIEW); }
void LoginDialog::loginFailed(const ApiError& error) { switch (error.type()) { case ApiError::SSL_ERROR: onSslErrors(error.sslReply(), error.sslErrors()); break; case ApiError::NETWORK_ERROR: onNetworkError(error.networkError(), error.networkErrorString()); break; case ApiError::HTTP_ERROR: onHttpError(error.httpErrorCode()); default: // impossible break; } }
void EventDetailsDialog::getCommitDetailsFailed(const ApiError& error) { ServerRepo repo = RepoService::instance()->getRepo(event_.repo_id); if (!repo.isValid()) { return; } if (repo.encrypted && error.type() == ApiError::HTTP_ERROR && error.httpErrorCode() == 400) { SetRepoPasswordDialog dialog(repo, this); if (dialog.exec() == QDialog::Accepted) { sendRequest(); } else { reject(); } } }