Skip to content

Commit 0fbb195

Browse files
authored
Merge pull request #4921 from Unity-Technologies/fix-permission-timers
Use more generic exception catching
2 parents b136878 + 787403e commit 0fbb195

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ and this project adheres to
5252
- Removed unnecessary memory allocations in `SideChannelManager.GetSideChannelMessage()` (#4886)
5353
- Removed several memory allocations that happened during inference. On a test scene, this
5454
reduced the amount of memory allocated by approximately 25%. (#4887)
55+
- Properly catch permission errors when writing timer files. (#4921)
5556

5657
#### ml-agents / ml-agents-envs / gym-unity (Python)
5758
- Fixed a bug that would cause an exception when `RunOptions` was deserialized via `pickle`. (#4842)

com.unity.ml-agents/Runtime/Timer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ public void SaveJsonTimers(string filename = null)
477477
SaveJsonTimers(fs);
478478
fs.Close();
479479
}
480-
catch (IOException)
480+
catch (SystemException)
481481
{
482-
// It's possible we don't have write access to the directory.
482+
// We may not have write access to the directory.
483483
Debug.LogWarning($"Unable to save timers to file {filename}");
484484
}
485485
#endif

0 commit comments

Comments
 (0)