mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 21:12:43 +02:00
Getting model by invalid ID throws a more specific exception.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user