Exceptions only thrown if configuration allows (#11)

This commit is contained in:
Biarity 2018-02-15 19:10:39 +10:00
parent 67606e281b
commit 24ba14e49f
2 changed files with 32 additions and 11 deletions

View File

@ -187,9 +187,16 @@ namespace Sieve.Services
}
catch (Exception ex)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
if (_options.Value.ThrowExceptions)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
}
else
{
return result;
}
}
}
@ -237,9 +244,16 @@ namespace Sieve.Services
}
catch (Exception ex)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
if (_options.Value.ThrowExceptions)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
}
else
{
return result;
}
}
}
@ -270,9 +284,16 @@ namespace Sieve.Services
}
catch (Exception ex)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
if (_options.Value.ThrowExceptions)
{
if (ex is SieveException)
throw;
throw new SieveException(ex.Message, ex);
}
else
{
return result;
}
}
}

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Sieve</id>
<version>1.3.91</version>
<version>1.3.92</version>
<title>Sieve</title>
<authors>Biarity</authors>
<owners>Biarity</owners>
@ -13,7 +13,7 @@
<description>
Sieve is a simple, clean, and extensible framework for .NET Core that adds sorting, filtering, and pagination functionality out of the box. Most common use case would be for serving ASP.NET Core GET queries. Documentation available on GitHub: https://github.com/Biarity/Sieve/
</description>
<releaseNotes>Custom method case-insensitivity, new custom exceptions</releaseNotes>
<releaseNotes>Base exception type, max pages feature</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>aspnetcore filter sort page paginate sieve search</tags>
<dependencies>