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