Skip to content

Commit dddf030

Browse files
committed
specifically catch IOException on getting compilation data
Fixes #12
1 parent 9cb5321 commit dddf030

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Editor/CompilationTrace.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private static CompilationData ConvertBeeDataToCompilationData()
141141
};
142142

143143
// fix up incorrect reported compilation times
144-
if(cc.compilationData != null && cc.compilationData.Any())
144+
if (cc.compilationData != null && cc.compilationData.Any())
145145
{
146146
// fix reported start/end times for compilation
147147
var minStart = cc.compilationData.Min(x => x.StartTime);
@@ -159,14 +159,21 @@ private static CompilationData ConvertBeeDataToCompilationData()
159159

160160
return cc;
161161
}
162+
catch (IOException e)
163+
{
164+
Debug.LogWarning($"IOException when trying to fetch compilation data: {e}. Please try again. If the issue persists: {bugReportString}");
165+
return null;
166+
}
162167
catch (Exception e)
163168
{
164-
var newIssueUrl = "https://github.com/needle-tools/compilation-visualizer/issues/new";
165-
Debug.LogError($"Couldn't fetch compilation data; the format has probably changed. Please report a bug at <a href=\"{newIssueUrl}\">{newIssueUrl}</a> and include the package + Unity version.\n" + e);
169+
Debug.LogError($"Couldn't fetch compilation data; the format has probably changed. {bugReportString}\n{e}");
166170
return null;
167171
}
168172
}
169173

174+
private static readonly string bugReportString = $"Please report a bug at <a href=\"{newIssueUrl}\">{newIssueUrl}</a> and include the package + Unity version.";
175+
const string newIssueUrl = "https://github.com/needle-tools/compilation-visualizer/issues/new";
176+
170177
public static void Clear()
171178
{
172179
if (File.Exists(ProfilerJson))

0 commit comments

Comments
 (0)