예제 #1
0
        private void ReportErrorAndRethrow(Exception exc, string operation, GoogleErrorCode errorCode)
        {
            var errMsg = String.Format(
                "Error doing {0} for Google Project {1} at PubSub Topic {2} " + Environment.NewLine
                + "Exception = {3}", operation, TopicName.ProjectId, TopicName.TopicId, exc);

            _logger.Error((int)errorCode, errMsg, exc);
            throw new AggregateException(errMsg, exc);
        }
예제 #2
0
 private void ReportErrorAndRethrow(Exception exc, string operation, GoogleErrorCode errorCode)
 {
     _logger.LogError(
         (int)errorCode,
         exc,
         "Error doing {Operation} for Google Project {ProjectId} at PubSub Topic {TopicId} ",
         operation,
         TopicName.ProjectId,
         TopicName.TopicId);
     throw new AggregateException(
               $"Error doing {operation} for Google Project {TopicName.ProjectId} at PubSub Topic {TopicName.TopicId} {Environment.NewLine}Exception = {exc}",
               exc);
 }
예제 #3
0
 internal static void Error(this ILogger logger, GoogleErrorCode errorCode, string message, Exception exception = null)
 {
     logger.LogError((int)errorCode, exception, message);
 }
예제 #4
0
 internal static void Warn(this ILogger logger, GoogleErrorCode errorCode, string message, Exception exception)
 {
     logger.LogWarning((int)errorCode, exception, message);
 }
예제 #5
0
 internal static void Warn(this ILogger logger, GoogleErrorCode errorCode, string format, params object[] args)
 {
     logger.LogWarning((int)errorCode, format, args);
 }
예제 #6
0
 internal static void Error(this Logger logger, GoogleErrorCode errorCode, string message, Exception exception = null)
 {
     logger.Log((int)errorCode, Severity.Error, message, new object[] { }, exception);
 }
예제 #7
0
 internal static void Warn(this Logger logger, GoogleErrorCode errorCode, string format, params object[] args)
 {
     logger.Log((int)errorCode, Severity.Warning, format, args, null);
 }