Example #1
0
        private async Task RunTaskAsync(Connection connection, string message)
        {
            try
            {
                await connection.RunAsync(message);
            }
            catch (CompilationErrorException ex)
            {
                Clients.Caller.CompilerError(CompilerError.ArrayFromException(ex));
            }
            catch (Exception e)
            {
                Clients.Caller.ConsoleOut("Error: " + e.Message + Environment.NewLine);

                if (e.InnerException != null)
                {
                    Clients.Caller.ConsoleOut(e.InnerException.Message);
                }
            }
            finally
            {
                connection.PostToQueue((QueueItemType.Complete, null));
            }
        }