mirror of
https://github.com/Radarr/Radarr
synced 2025-02-27 00:23:19 +00:00
Fixed: Adding an invalid root folder will show a usable error message
This commit is contained in:
parent
e47b4c7686
commit
0247aebb25
1 changed files with 13 additions and 2 deletions
|
@ -1,4 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using FluentValidation;
|
||||||
|
using FluentValidation.Results;
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
using NzbDrone.Core.RootFolders;
|
using NzbDrone.Core.RootFolders;
|
||||||
using NzbDrone.Api.Mapping;
|
using NzbDrone.Api.Mapping;
|
||||||
|
@ -30,7 +33,15 @@ private RootFolderResource GetRootFolder(int id)
|
||||||
|
|
||||||
private int CreateRootFolder(RootFolderResource rootFolderResource)
|
private int CreateRootFolder(RootFolderResource rootFolderResource)
|
||||||
{
|
{
|
||||||
return GetNewId<RootFolder>(_rootFolderService.Add, rootFolderResource);
|
try
|
||||||
|
{
|
||||||
|
return GetNewId<RootFolder>(_rootFolderService.Add, rootFolderResource);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ValidationException(new [] { new ValidationFailure("Path", ex.Message) });
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<RootFolderResource> GetRootFolders()
|
private List<RootFolderResource> GetRootFolders()
|
||||||
|
|
Loading…
Reference in a new issue