Skip to content

Commit

Permalink
Add more errors codes that have been added in the mean time
Browse files Browse the repository at this point in the history
DataDoesNotExist, OperationFailed, SystemSnDoesNotExist, SystemOffline.

Also turns out 6026 is "internal error".
  • Loading branch information
kbroulik committed Dec 17, 2023
1 parent a6f8b3d commit aa6cc11
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
21 changes: 20 additions & 1 deletion src/lib/qalphacloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,31 @@ QString errorText(ErrorCode code, const QVariant &details)
return QCoreApplication::translate("errorText", "Application ID was not provided.");
}
break;

case ErrorCode::DataDoesNotExist:
if (detailsString.isEmpty()) {
return QCoreApplication::translate("errorText", "Data does not exist or has been deleted.");
}
break;
case ErrorCode::InvalidDate:
if (detailsString.isEmpty()) {
return QCoreApplication::translate("errorText", "Invalid date provided.");
}
break;
case ErrorCode::OperationFailed:
if (detailsString.isEmpty()) {
return QCoreApplication::translate("errorText", "Operation failed.");
}
break;
case ErrorCode::SystemSnDoesNotExist:
if (detailsString.isEmpty()) {
return QCoreApplication::translate("errorText", "System serial number does not exist.");
}
break;
case ErrorCode::SystemOffline:
if (detailsString.isEmpty()) {
return QCoreApplication::translate("errorText", "System is offline.");
}
break;

case ErrorCode::VerificationCode:
if (detailsString.isEmpty()) {
Expand Down
8 changes: 5 additions & 3 deletions src/lib/qalphacloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ enum class ErrorCode {
SignEmpty = 6010, ///< "Sign is empty"
TimestampEmpty = 6011, ///< "timestamp is empty"
AppIdEmpty = 6012, ///< "AppId is empty"

InvalidDate = 6026, ///< Date is invalid, undocumented. Also returned when requesting historic data for a future date.

DataDoesNotExist = 6016, ///< "Data does not exist or has been deleted"
InvalidDate = 6026, ///< Date is invalid, documented as "internal error". Also returned when requesting historic data for a future date.
OperationFailed = 6029, ///< "Operation failed"
SystemSnDoesNotExist = 6038, ///< "system sn does not exist"
SystemOffline = 6042, ///< "system offline"
VerificationCode = 6046, ///< "Verification code error"
TooManyRequests = 6053, ///< "The request was too fast, please try again later"
};
Expand Down

0 comments on commit aa6cc11

Please sign in to comment.