Skip to content

Commit 1bf0da8

Browse files
committed
- OCConnection+Upload: add proper handling for 409 status code
1 parent 4f570ca commit 1bf0da8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ownCloudSDK/Connection/OCConnection+Upload.m

+7
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,13 @@ - (void)_handleDirectUploadFileResult:(OCHTTPRequest *)request error:(NSError *)
973973
}
974974
break;
975975

976+
case OCHTTPStatusCodeCONFLICT: {
977+
NSString *errorDescription = nil;
978+
errorDescription = [NSString stringWithFormat:OCLocalizedString(@"Another version of %@ already exists in %@.",nil), fileName, parentItem.name];
979+
event.error = OCErrorWithDescription(OCErrorItemAlreadyExists, errorDescription);
980+
}
981+
break;
982+
976983
case OCHTTPStatusCodeINSUFFICIENT_STORAGE: {
977984
NSString *errorDescription = nil;
978985

ownCloudSDK/Resources/Localizable.xcstrings

+10
Original file line numberDiff line numberDiff line change
@@ -2943,6 +2943,16 @@
29432943
}
29442944
}
29452945
},
2946+
"Another version of %@ already exists in %@." : {
2947+
"localizations" : {
2948+
"en" : {
2949+
"stringUnit" : {
2950+
"state" : "new",
2951+
"value" : "Another version of %1$@ already exists in %2$@."
2952+
}
2953+
}
2954+
}
2955+
},
29462956
"At least {{min}} {{characterType}}" : {
29472957
"comment" : "Password Policy Check",
29482958
"extractionState" : "manual",

0 commit comments

Comments
 (0)