Пример #1
0
        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;
            }
        }
Пример #2
0
        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;
            }
        }