Skip to content

Commit ad006a2

Browse files
committed
Core/Portable: update logging, exception handling
also update comments in `PreStartCleanUpAfterPortabilityUpdate`
1 parent 3a712b7 commit ad006a2

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Flow.Launcher.Core/Configuration/Portable.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ public void DisablePortableMode()
4747
}
4848
catch (Exception e)
4949
{
50-
#if !DEBUG
51-
Log.Exception("Portable", "Error occured while disabling portable mode", e);
52-
#endif
53-
throw;
50+
Log.Exception("|Portable.DisablePortableMode|Error occured while disabling portable mode", e);
5451
}
5552
}
5653

@@ -74,10 +71,7 @@ public void EnablePortableMode()
7471
}
7572
catch (Exception e)
7673
{
77-
#if !DEBUG
78-
Log.Exception("Portable", "Error occured while enabling portable mode", e);
79-
#endif
80-
throw;
74+
Log.Exception("|Portable.EnablePortableMode|Error occured while enabling portable mode", e);
8175
}
8276
}
8377

@@ -159,7 +153,8 @@ public void PreStartCleanUpAfterPortabilityUpdate()
159153
var portableDataDeleteFilePath = Path.Combine(portableDataDir, DataLocation.DeletionIndicatorFile);
160154
var roamingDataDeleteFilePath = Path.Combine(roamingDataDir, DataLocation.DeletionIndicatorFile);
161155

162-
// Should we switch from %AppData% to portable mode?
156+
// If the data folder in %appdata% is marked for deletion,
157+
// delete it and prompt the user to pick the portable data location
163158
if (File.Exists(roamingDataDeleteFilePath))
164159
{
165160
FilesFolders.RemoveFolderIfExists(roamingDataDir);
@@ -173,7 +168,8 @@ public void PreStartCleanUpAfterPortabilityUpdate()
173168
Environment.Exit(0);
174169
}
175170
}
176-
// Should we switch from portable mode to %AppData%?
171+
// Otherwise, if the portable data folder is marked for deletion,
172+
// delete it and notify the user about it.
177173
else if (File.Exists(portableDataDeleteFilePath))
178174
{
179175
FilesFolders.RemoveFolderIfExists(portableDataDir);

0 commit comments

Comments
 (0)