mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-22 13:32:33 +01:00
Cleaner exception handling
This commit is contained in:
parent
24ba14e49f
commit
54ab424087
@ -356,8 +356,6 @@ namespace Sieve.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ArgumentException) // name matched with custom method for a differnt type
|
catch (ArgumentException) // name matched with custom method for a differnt type
|
||||||
{
|
|
||||||
if (_options.Value.ThrowExceptions)
|
|
||||||
{
|
{
|
||||||
var expected = typeof(IQueryable<TEntity>);
|
var expected = typeof(IQueryable<TEntity>);
|
||||||
var actual = customMethod.ReturnType;
|
var actual = customMethod.ReturnType;
|
||||||
@ -365,8 +363,7 @@ namespace Sieve.Services
|
|||||||
$"{name} failed. Expected a custom method for type {expected} but only found for type {actual}");
|
$"{name} failed. Expected a custom method for type {expected} but only found for type {actual}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else if (_options.Value.ThrowExceptions)
|
|
||||||
{
|
{
|
||||||
throw new SieveMethodNotFoundException(name,
|
throw new SieveMethodNotFoundException(name,
|
||||||
$"{name} not found.");
|
$"{name} not found.");
|
||||||
|
Loading…
Reference in New Issue
Block a user