Prevent adding a root folder that is the same as drone factory

This commit is contained in:
Mark McDowall 2013-08-02 00:16:37 -07:00
commit 485f05d4b9
6 changed files with 33 additions and 11 deletions

View file

@ -1,8 +1,11 @@
using System;
using System.Net;
using FluentValidation;
using NLog;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Common.Exceptions;
using HttpStatusCode = Nancy.HttpStatusCode;
namespace NzbDrone.Api.ErrorManagement
{
@ -31,14 +34,11 @@ namespace NzbDrone.Api.ErrorManagement
{
_logger.Warn("Invalid request {0}", validationException.Message);
return validationException.Errors.AsResponse(HttpStatusCode.BadRequest);
}
_logger.FatalException("Request Failed", exception);
return new ErrorModel()
{
Message = exception.Message,