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); }
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); }
internal static void Error(this ILogger logger, GoogleErrorCode errorCode, string message, Exception exception = null) { logger.LogError((int)errorCode, exception, message); }
internal static void Warn(this ILogger logger, GoogleErrorCode errorCode, string message, Exception exception) { logger.LogWarning((int)errorCode, exception, message); }
internal static void Warn(this ILogger logger, GoogleErrorCode errorCode, string format, params object[] args) { logger.LogWarning((int)errorCode, format, args); }
internal static void Error(this Logger logger, GoogleErrorCode errorCode, string message, Exception exception = null) { logger.Log((int)errorCode, Severity.Error, message, new object[] { }, exception); }
internal static void Warn(this Logger logger, GoogleErrorCode errorCode, string format, params object[] args) { logger.Log((int)errorCode, Severity.Warning, format, args, null); }