private static void ErrorFrom(string errorLocation, PluginLoggerBase pluginLoggerBase) { var errorKind = Environment.GetEnvironmentVariable(errorLocation); switch (errorKind) { case "Exception": throw new Exception($"Cache plugin exception from {errorLocation}"); case "LoggedError": pluginLoggerBase?.LogError($"Cache plugin logged error from {errorLocation}"); break; } }
private static void ErrorFrom(string errorLocation, PluginLoggerBase pluginLoggerBase) { var errorKind = Environment.GetEnvironmentVariable(errorLocation); switch (errorKind) { case "Exception": pluginLoggerBase?.LogMessage($"{errorLocation} is going to throw an exception", MessageImportance.High); throw new Exception($"Cache plugin exception from {errorLocation}"); case "LoggedError": pluginLoggerBase?.LogError($"Cache plugin logged error from {errorLocation}"); break; } }