1
0

Fix remove if not found in Sia

This commit is contained in:
Scott Graves
2017-04-06 14:32:28 -05:00
parent 8ebc8694b1
commit 14451b8a43
3 changed files with 5 additions and 3 deletions

View File

@@ -260,7 +260,9 @@ private:
public:
virtual SString GetSingleLineMessage() const override
{
return L"FailedToRemoveFileFromSia|SP|" + _siaPath + L"|FP|" + _filePath;
return L"FailedToRemoveFileFromSia|SP|" + _siaPath +
L"|FP|" + _filePath +
L"|CERR|" + _curlError.GetReason();
}
virtual std::shared_ptr<CEvent> Clone() const override

View File

@@ -159,7 +159,7 @@ SiaCurlError CSiaCurl::ProcessResponse(const int& res, const int& httpCode, cons
}
else if (httpCode)
{
ret = { SiaCurlErrorCode::HttpError, GetApiErrorMessage(result) };
ret = { SiaCurlErrorCode::HttpError, SString::FromInt32(httpCode) + ":" + (result.length() ? GetApiErrorMessage(json::parse(result.c_str())) : "") };
}
else
{

View File

@@ -125,7 +125,7 @@ bool CUploadManager::HandleFileRemove(const CSiaCurl& siaCurl, const SString& si
json response;
SiaCurlError cerror = siaCurl.Post(SString(L"/renter/delete/") + siaPath, {}, response);
if (ApiSuccess(cerror))
if (ApiSuccess(cerror) || cerror.GetReason().Contains("no file known"))
{
SQLite::Statement del(_uploadDatabase, DELETE_UPLOAD);
del.bind("@sia_path", SString::ToUtf8(siaPath).c_str());