本文整理汇总了C++中ApiError类的典型用法代码示例。如果您正苦于以下问题:C++ ApiError类的具体用法?C++ ApiError怎么用?C++ ApiError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApiError类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCreateDirFailed
void FileUploadDirectoryTask::onCreateDirFailed(const ApiError &error)
{
error_ = ApiRequestError;
error_string_ = error.toString();
http_error_code_ = error.httpErrorCode();
FileUploadDirectoryTask::onFinished(false);
}
示例2: onCreateDefaultRepoFailure
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()));
}
}
示例3: onGetLinkFailed
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);
}
示例4: onLogoutDeviceRequestFailed
void AccountView::onLogoutDeviceRequestFailed(const ApiError& error)
{
LogoutDeviceRequest *req = (LogoutDeviceRequest *)QObject::sender();
req->deleteLater();
QString msg;
if (error.httpErrorCode() == 404) {
msg = tr("Logging out is not supported on your server (version too low).");
} else {
msg = tr("Failed to remove information on server: %1").arg(error.toString());
}
seafApplet->warningBox(msg, this);
}
示例5: refreshFailed
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);
}
示例6: onGetRepoTokensFailed
void AccountView::onGetRepoTokensFailed(const ApiError& error)
{
GetRepoTokensRequest *req = (GetRepoTokensRequest *)QObject::sender();
req->deleteLater();
seafApplet->warningBox(
tr("Failed to get repo sync information from server: %1").arg(error.toString()), this);
}
示例7: onDownloadRepoRequestFailed
void DownloadRepoDialog::onDownloadRepoRequestFailed(const ApiError& error)
{
QString msg = tr("Failed to get repo download information:\n%1").arg(error.toString());
seafApplet->warningBox(msg, this);
setAllInputsEnabled(true);
}
示例8: createFailed
void CreateRepoDialog::createFailed(const ApiError& error)
{
mStatusText->setText("");
QString msg = tr("Failed to create library on the server:\n%1").arg(error.toString());
seafApplet->warningBox(msg, this);
setAllInputsEnabled(true);
}
示例9: getCommitDetailsFailed
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();
}
}
}
示例10: switch
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;
}
}
示例11: onDownloadRepoFailure
void InitVirtualDriveDialog::onDownloadRepoFailure(const ApiError& error)
{
fail(tr("Failed to download default library:\n%1").arg(error.toString()));
}
示例12: serverInfoFailed
void AccountManager::serverInfoFailed(const ApiError &error)
{
qWarning("update server info failed %s\n", error.toString().toUtf8().data());
}
示例13: onLockFileFailed
void SeafileExtensionHandler::onLockFileFailed(const ApiError& error)
{
LockFileRequest *req = qobject_cast<LockFileRequest *>(sender());
QString str = req->lock() ? tr("Failed to lock file") : tr("Failed to unlock file");
seafApplet->warningBox(QString("%1: %2").arg(str, error.toString()));
}