Пример #1
0
        public async Task HandleAsync(T message)
        {
            try
            {
                await _decorated.HandleAsync(message).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                await _debugMessageManager.ShowAsync($"[ERROR]: {e.ToString().Substring(0,500)}").ConfigureAwait(false);

                throw;
            }
        }
Пример #2
0
        public async Task HandleAsync(T message)
        {
            var sw = new Stopwatch();

            sw.Start();

            await _decorated.HandleAsync(message).ConfigureAwait(false);

            sw.Stop();

            await _debugMessageManager.ShowAsync($"{message.GetType().Name}:ActionDuration: {FormatElapsedTime(sw)}")
            .ConfigureAwait(false);
        }