24 : mErrorNumber(NO_ERR)
31Error::Error(ErrorNumber errNo,
int httpStatusCode,
int responseCode,
const QString &errorText,
int jobErrorCode)
33 , mHttpStatusCode(httpStatusCode)
34 , mResponseCode(responseCode)
35 , mErrorText(errorText)
36 , mJobErrorCode(jobErrorCode)
40ErrorNumber Error::errorNumber()
const
50int Error::jobErrorCode()
const
55int Error::httpStatusCode()
const
57 return mHttpStatusCode;
60int Error::responseCode()
const
65QString Error::description()
const
67 switch (mErrorNumber) {
68 case ERR_PROBLEM_WITH_REQUEST: {
71 if (mHttpStatusCode == 401) {
72 err = QStringLiteral(
"Invalid username/password");
73 }
else if (mHttpStatusCode == 403) {
74 err = QStringLiteral(
"Access forbidden");
75 }
else if (mHttpStatusCode == 404) {
76 err = QStringLiteral(
"Resource not found");
78 err = QStringLiteral(
"HTTP error");
80 return QStringLiteral(
"There was a problem with the request.\n"
81 "%1 (%2).").
arg(err).
arg(mHttpStatusCode);
84 return QStringLiteral(
"Protocol for the collection does not support MULTIGET");
85 case ERR_SERVER_UNRECOVERABLE:
86 return QStringLiteral(
"The server encountered an error that prevented it from completing your request: %1 (%2)").arg(mErrorText).arg(mHttpStatusCode);
87 case ERR_COLLECTIONDELETE:
88 return QStringLiteral(
"There was a problem with the request. The collection has not been deleted from the server.\n"
89 "%1 (%2).").arg(mErrorText).arg(mHttpStatusCode);
90 case ERR_COLLECTIONFETCH:
91 return QStringLiteral(
"Invalid responses from backend");
92 case ERR_COLLECTIONFETCH_XQUERY_SETFOCUS:
93 return QStringLiteral(
"Error setting focus for XQuery");
94 case ERR_COLLECTIONFETCH_XQUERY_INVALID:
95 return QStringLiteral(
"Invalid XQuery submitted by DAV implementation");
96 case ERR_COLLECTIONMODIFY:
97 return QStringLiteral(
"There was a problem with the request. The collection has not been modified on the server.\n"
98 "%1 (%2).").arg(mErrorText).arg(mHttpStatusCode);
99 case ERR_COLLECTIONMODIFY_NO_PROPERITES:
100 return QStringLiteral(
"No properties to change or remove");
101 case ERR_COLLECTIONMODIFY_RESPONSE: {
102 auto result = QStringLiteral(
"There was an error when modifying the properties");
104 result.append(QStringLiteral(
"\nThe server returned more information:\n%1").arg(mErrorText));
108 case ERR_COLLECTIONCREATE:
109 return QStringLiteral(
"There was an error when creating the collection");
111 return QStringLiteral(
"There was a problem with the request. The item has not been created on the server.\n"
112 "%1 (%2).").arg(mErrorText).arg(mHttpStatusCode);
114 return QStringLiteral(
"There was a problem with the request. The item has not been deleted from the server.\n"
115 "%1 (%2).").arg(mErrorText).arg(mHttpStatusCode);
117 return QStringLiteral(
"There was a problem with the request. The item was not modified on the server.\n"
118 "%1 (%2).").arg(mErrorText).arg(mHttpStatusCode);
120 return QStringLiteral(
"There was a problem with the request.");
121 case ERR_ITEMLIST_NOMIMETYPE:
122 return QStringLiteral(
"There was a problem with the request. The requested mimetypes are not supported.");
QString arg(Args &&... args) const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:18 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.