Skip to content

Commit

Permalink
Fix issue #2815 (#2817)
Browse files Browse the repository at this point in the history
* If 'sync_list' is being used, and the file online contains URL encoded items, and cannot be URL decoded, catch the exception generated and generate an error message regarding the issue to advise the user to rename the offending item online.
  • Loading branch information
abraunegg committed Sep 18, 2024
1 parent f3b4a33 commit fd3a34e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -3835,7 +3835,17 @@ class SyncEngine {
if (containsURLEncodedItems(selfBuiltPath)) {
// decode it
addLogEntry("selfBuiltPath for sync_list check needs decoding: " ~ selfBuiltPath, ["debug"]);
newItemPath = decodeComponent(selfBuiltPath);

try {
// try and decode selfBuiltPath
newItemPath = decodeComponent(selfBuiltPath);
} catch (URIException exception) {
// why?
addLogEntry("ERROR: Unable to URL Decode path: " ~ exception.msg);
addLogEntry("ERROR: To resolve, rename this item online: " ~ selfBuiltPath);
// have to use as-is due to decode error
newItemPath = selfBuiltPath;
}
} else {
// use as-is
newItemPath = selfBuiltPath;
Expand Down

0 comments on commit fd3a34e

Please sign in to comment.