private void OnBufferOverflow(object sender, ErrorEventArgs e) { // Todo: We should at some point implement a mechanism to try and recover from buffer overflows in the file watcher. try { QsCompilerError.Raise($"buffer overflow in file system watcher: \n{e.GetException()}"); } catch (Exception ex) { this.onException(ex); } }
private Task ProcessingTaskAsync(Action action) => new Task(() => { try { QsCompilerError.RaiseOnFailure(action, this.exceptionHeader); } catch (Exception ex) { this.logException(ex); } });
// language server tools - // wrapping these into a try .. catch .. to make sure errors don't go unnoticed as they otherwise would public static T TryJTokenAs <T>(JToken arg) where T : class => QsCompilerError.RaiseOnFailure(() => arg.ToObject <T>(), $"failed cast jtoken to {typeof(T).Name}");