mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 12:53:33 +08:00
23 lines
775 B
C#
23 lines
775 B
C#
using System;
|
|
using System.Web.Mvc;
|
|
using Orchard.Localization;
|
|
using Orchard.Logging;
|
|
using Orchard.UI.Notify;
|
|
|
|
namespace Orchard.Utility.Extensions {
|
|
public static class ControllerExtensions {
|
|
public static void Error(this Controller controller,
|
|
Exception exception,
|
|
LocalizedString localizedString,
|
|
ILogger logger,
|
|
INotifier notifier) {
|
|
|
|
logger.Error(exception, localizedString.ToString());
|
|
notifier.Error(localizedString);
|
|
|
|
for (Exception innerException = exception; innerException != null ; innerException = innerException.InnerException) {
|
|
notifier.Error(new LocalizedString(innerException.Message));
|
|
}
|
|
}
|
|
}
|
|
} |