mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Getting model by invalid ID throws a more specific exception.
This commit is contained in:
parent
f3534de0c5
commit
54c36e9264
8 changed files with 38 additions and 11 deletions
|
@ -68,8 +68,15 @@ namespace NzbDrone.Api.REST
|
|||
Get[ID_ROUTE] = options =>
|
||||
{
|
||||
ValidateId(options.Id);
|
||||
var resource = GetResourceById((int)options.Id);
|
||||
return resource.AsResponse();
|
||||
try
|
||||
{
|
||||
var resource = GetResourceById((int)options.Id);
|
||||
return resource.AsResponse();
|
||||
}
|
||||
catch (ModelNotFoundException)
|
||||
{
|
||||
return new NotFoundResponse();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue