laget.Exceptions
1.0.80
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package laget.Exceptions --version 1.0.80
NuGet\Install-Package laget.Exceptions -Version 1.0.80
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="laget.Exceptions" Version="1.0.80" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="laget.Exceptions" Version="1.0.80" />
<PackageReference Include="laget.Exceptions" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add laget.Exceptions --version 1.0.80
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: laget.Exceptions, 1.0.80"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=laget.Exceptions&version=1.0.80
#tool nuget:?package=laget.Exceptions&version=1.0.80
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Exceptions
A generic implementation of Exceptions used in our applications...
Usage
public class ConstraintException : laget.Exceptions.Exception
{
public override HttpStatusCode StatusCode => HttpStatusCode.MethodNotAllowed;
public ConstraintException(string message)
: base(message)
{
}
public ConstraintException(string message, Exception ex)
: base(message, ex)
{
}
}
Middleware
public class ExceptionMiddleware
{
readonly RequestDelegate _next;
public ExceptionMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context)
{
try
{
await _next(context);
}
catch (laget.Exceptions.Exception ex)
{
await HandleExceptionAsync(context, ex);
}
catch (Exception e)
{
if (e.InnerException?.GetBaseException() is laget.Exceptions.Exception)
{
await HandleExceptionAsync(context, e.InnerException?.GetBaseException() as laget.Exceptions.Exception);
}
await HandleExceptionAsync(context, e);
}
}
static Task HandleExceptionAsync(HttpContext context, Exception ex)
{
return HandleExceptionAsync(context, ex.GetResponse());
}
static Task HandleExceptionAsync(HttpContext context, laget.Exceptions.Exception ex)
{
return HandleExceptionAsync(context, ex.GetResponse());
}
static Task HandleExceptionAsync(HttpContext context, laget.Exceptions.Models.Response model)
{
context.Response.Clear();
context.Response.ContentType = "application/problem+json";
context.Response.StatusCode = model.Status ?? (int)HttpStatusCode.InternalServerError;
var response = JsonConvert.SerializeObject(model);
return context.Response.WriteAsync(response);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.3)
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on laget.Exceptions:
Package | Downloads |
---|---|
laget.Youcal.Integration.Sdk
Software Development Kit (SDK) for the integration between laget.se and Youcal. |
|
laget.Premium.Subscription.Sdk
This is the Software Development Kit (SDK) for our Premium Subscription System |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.4 | 1,652 | 1/20/2024 |
1.2.3 | 2,073 | 11/22/2023 |
1.2.2 | 144 | 11/14/2023 |
1.2.1 | 3,532 | 9/28/2023 |
1.1.1 | 2,616 | 9/8/2023 |
1.0.81 | 2,092 | 7/3/2023 |
1.0.80 | 3,011 | 4/5/2023 |
1.0.79 | 1,499 | 3/10/2023 |
1.0.18 | 499 | 7/8/2022 |
1.0.16 | 7,478 | 9/22/2021 |
1.0.15 | 435 | 8/16/2021 |
1.0.14 | 708 | 7/5/2021 |
1.0.13 | 4,408 | 4/6/2021 |
1.0.12 | 449 | 3/5/2021 |
1.0.11 | 521 | 2/1/2021 |
1.0.10 | 939 | 1/8/2021 |
1.0.9 | 3,005 | 12/23/2020 |
1.0.8 | 588 | 12/22/2020 |
1.0.7 | 436 | 12/22/2020 |
1.0.6 | 488 | 12/17/2020 |
1.0.5 | 453 | 12/17/2020 |
1.0.4 | 484 | 12/17/2020 |
1.0.3 | 512 | 12/17/2020 |
1.0.2 | 460 | 12/17/2020 |
1.0.1 | 478 | 12/17/2020 |