Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.10.x' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Apr 13, 2017
2 parents 324261b + d384110 commit f146acf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Orchard.Localization;
using System.Linq;
using Orchard.FileSystems.Media;
using Orchard.Logging;

namespace Orchard.MediaLibrary.Controllers {
[Admin, Themed(false)]
Expand All @@ -26,10 +27,12 @@ public ClientStorageController(
_mimeTypeProvider = mimeTypeProvider;
Services = orchardServices;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
}

public IOrchardServices Services { get; set; }
public Localizer T { get; set; }
public ILogger Logger { get; set; }

public ActionResult Index(string folderPath, string type, int? replaceId = null) {
if (!Services.Authorizer.Authorize(Permissions.ManageOwnMedia)) {
Expand Down Expand Up @@ -110,6 +113,7 @@ public ActionResult Upload(string folderPath, string type) {
});
}
catch (Exception ex) {
Logger.Error(ex, "Unexpected exception when uploading a media.");
statuses.Add(new {
error = T(ex.Message).Text,
progress = 1.0,
Expand Down Expand Up @@ -189,6 +193,8 @@ public ActionResult Replace(int replaceId, string type) {
});
}
catch (Exception ex) {
Logger.Error(ex, "Unexpected exception when uploading a media.");

statuses.Add(new {
error = T(ex.Message).Text,
progress = 1.0,
Expand Down

0 comments on commit f146acf

Please sign in to comment.