OwlDomain.Common.Throw
2.0.1
Prefix Reserved
dotnet add package OwlDomain.Common.Throw --version 2.0.1
NuGet\Install-Package OwlDomain.Common.Throw -Version 2.0.1
<PackageReference Include="OwlDomain.Common.Throw" Version="2.0.1" />
paket add OwlDomain.Common.Throw --version 2.0.1
#r "nuget: OwlDomain.Common.Throw, 2.0.1"
// Install OwlDomain.Common.Throw as a Cake Addin #addin nuget:?package=OwlDomain.Common.Throw&version=2.0.1 // Install OwlDomain.Common.Throw as a Cake Tool #tool nuget:?package=OwlDomain.Common.Throw&version=2.0.1
Common.Throw
A package that provides non-inlinable helper methods for throwing different exceptions, meant to reduce the binary size.
This package is optional and you can always replace it with your own custom throw methods,
if you wish to do so check out the OwlDomain.Common.Throw.Base
package.
Usage
Using the provided packages is extremely simple, after referencing them from your project
simply use the OwlDomain.Common
namespace, which will provide you access to the static
Throw
class, which provides the static property For
, on which you will have
access to all of the extension methods for throwing exceptions.
An example of this would be
using OwlDomain.Common;
Throw.For.Argument("message", "parameterName");
// Equivalent to
throw new ArgumentException("message", "parameterName");
There will be cases where the compiler complains that you aren't returning a value, when you use the regular throw statements that doesn't happen, however the compiler will still complain when it comes to methods, even if they are marked with the DoesNotReturnAttribute.
For this reason, each of the throw methods also has a generic overload which pretends to return a value of whatever type you wish, you would use it like so:
using OwlDomain.Common;
return Throw.ForArgument<int>("message", "parameterName");
License
This project (the source, and the release files, e.t.c) is release under the OwlDomain License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- OwlDomain.Common.Throw.Base (>= 2.0.1)
- OwlDomain.Polyease (>= 1.3.2)
-
net6.0
- OwlDomain.Common.Throw.Base (>= 2.0.1)
- OwlDomain.Polyease (>= 1.3.2)
-
net7.0
- OwlDomain.Common.Throw.Base (>= 2.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OwlDomain.Common.Throw:
Package | Downloads |
---|---|
OwlDomain.Common.Throw.Guards
A package that provides guard methods used for throwing exceptions if the required conditions are not met. |
|
OwlDomain.Common
A package that contains various commonly used code. |
GitHub repositories
This package is not used by any popular GitHub repositories.