本文整理汇总了C++中ApiError::httpErrorCode方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiError::httpErrorCode方法的具体用法?C++ ApiError::httpErrorCode怎么用?C++ ApiError::httpErrorCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiError
的用法示例。
在下文中一共展示了ApiError::httpErrorCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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()));
}
}
示例2: 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);
}
示例3: 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);
}
示例4: loginFailed
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;
}
}
示例5: 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();
}
}
}