From 0908edc812a20801373f7c5b9c2296465fbee789 Mon Sep 17 00:00:00 2001 From: Arthur Juliani Date: Mon, 8 Feb 2021 11:09:21 -0800 Subject: [PATCH 1/2] Use more generic exception catching --- com.unity.ml-agents/Runtime/Timer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 787403e2464aed4cdec1f10b93052c2f54b2a779 Mon Sep 17 00:00:00 2001 From: Arthur Juliani Date: Mon, 8 Feb 2021 13:40:25 -0800 Subject: [PATCH 2/2] Update changelog --- com.unity.ml-agents/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)