Exceptions
Introduction
This page explain a bit more about LeoCorpLibrary's custom exceptions.
Do not forget to put this line of code in your "using" region:
C#
using LeoCorpLibrary;
VB
Imports LeoCorpLibrary
ColorsConverter
In this section, you will find all exceptions thrown when a problem occurs
RGBInvalidValueException
Compatibility
Frameworks | LeoCorpLibrary | LeoCorpLibrary.Core |
---|---|---|
.NET 6 | ✔ | ✔ |
.NET 5 | ✔ | ✔ |
.NET Core 3.1 | ✔ | ✔ |
.NET Framework 4.5 | ✔ | ✔ |
This exception is thrown when a value int
for instance, doesn't have a valid RGB format: The number must be between 0 and 255 included.
It's in:
LeoCorpLibrary.Exceptions.RGBInvalidValueException
Here's an example of usage:
C#
throw new RGBInvalidValueException("Message here");
VB
Throw New RGBInvalidValueException("Message here")
HEXInvalidValueException
Compatibility
Frameworks | LeoCorpLibrary | LeoCorpLibrary.Core |
---|---|---|
.NET 6 | ✔ | ✔ |
.NET 5 | ✔ | ✔ |
.NET Core 3.1 | ✔ | ✔ |
.NET Framework 4.5 | ✔ | ✔ |
This exception is thrown when a string
doesn't have a valid HEX format.
It's in:
LeoCorpLibrary.Exceptions.HEXInvalidValueException
Here's an example of usage:
C#
throw new HEXInvalidValueException("Message here");
VB
Throw New HEXInvalidValueException("Message here")
GuidGenerator
InvalidGuidLengthException
Compatibility
Frameworks | LeoCorpLibrary | LeoCorpLibrary.Core |
---|---|---|
.NET 6 | ✔ | ✔ |
.NET 5 | ✔ | ✔ |
.NET Core 3.1 | ✔ | ✔ |
.NET Framework 4.5 | ✔ | ✔ |
This exception is thrown when the specified length for a Guid is invalid. A valid Guid length is an integer between 1 and 32. The default length is 32.
It's in:
LeoCorpLibrary.Exceptions.InvalidGuidLengthException
Here's an example of usage:
C#
throw new InvalidGuidLengthException("Message here");
VB
Throw New InvalidGuidLengthException("Message here")