diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 4e1acad93e..1e43302099 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -52,6 +52,7 @@ and this project adheres to - Removed unnecessary memory allocations in `SideChannelManager.GetSideChannelMessage()` (#4886) - Removed several memory allocations that happened during inference. On a test scene, this reduced the amount of memory allocated by approximately 25%. (#4887) +- Properly catch permission errors when writing timer files. (#4921) #### ml-agents / ml-agents-envs / gym-unity (Python) - Fixed a bug that would cause an exception when `RunOptions` was deserialized via `pickle`. (#4842) diff --git a/com.unity.ml-agents/Runtime/Timer.cs b/com.unity.ml-agents/Runtime/Timer.cs index d779deb650..446d780af7 100644 --- a/com.unity.ml-agents/Runtime/Timer.cs +++ b/com.unity.ml-agents/Runtime/Timer.cs @@ -477,9 +477,9 @@ public void SaveJsonTimers(string filename = null) SaveJsonTimers(fs); fs.Close(); } - catch (IOException) + catch (SystemException) { - // It's possible we don't have write access to the directory. + // We may not have write access to the directory. Debug.LogWarning($"Unable to save timers to file {filename}"); } #endif