Skip to content

Commit

Permalink
Try Catch SetCurrentDir
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisFeline committed Dec 27, 2024
1 parent 5f8227e commit f9751f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ internal static bool ContainsArg(string arg) {
[STAThread]
static void Main(string[] args)
{
Directory.SetCurrentDirectory(ProgramDirectory);
Logger.Log("Initializing logging.");
Logger.Log("Program Directory: " + ProgramDirectory);

try {
Directory.SetCurrentDirectory(ProgramDirectory);
Logger.Log("Program Directory: " + ProgramDirectory);
} catch (Exception e) {
Logger.Error("Failed to set Program Directory to: " + ProgramDirectory);
Logger.Error(e.ToString());
}

Arguments = args;
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
Expand Down

0 comments on commit f9751f3

Please sign in to comment.