/// <summary> /// Takes a full dump of the internal error and writes it to file. /// </summary> public static Task ExecuteDump(EngineComputationException error) { return(Task.Run(async() => { try { // TODO: why does await not work anymore? using (var fs = FileOperations.CreateOrTruncateFile(FileNaming.ErrorDumpPath)) { //using(var fs = await FileOperations.CreateOrTruncateFile(FileNaming.ErrorDumpPath)) { using (var writer = new StreamWriter(fs)) { writer.WriteLine(App.ApplicationInformation); writer.WriteLine("Engine dump recorded on {0:u}", DateTime.UtcNow); writer.WriteLine(); WriteBuffer(writer, "Primary buffer", error.PrimaryBufferSnapshot); writer.WriteLine(); WriteBuffer(writer, "Secondary buffer", error.SecondaryBufferSnapshot); } } } catch (Exception ex) { Log.Error(ex, "Failed while writing engine dump"); } })); }
public InternalEngineErrorEventArgs(EngineComputationException exception) { Exception = exception; }
protected virtual void OnInternalEngineErrorReported(EngineComputationException exception) { InternalEngineErrorReported?.Invoke(this, new InternalEngineErrorEventArgs(exception)); }