示例#1
0
 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);
     }
 }
示例#2
0
 private Task ProcessingTaskAsync(Action action) =>
 new Task(() =>
 {
     try
     {
         QsCompilerError.RaiseOnFailure(action, this.exceptionHeader);
     }
     catch (Exception ex)
     {
         this.logException(ex);
     }
 });
示例#3
0
        // 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}");