# 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

Go to top

# ColorsConverter

In this section, you will find all exceptions thrown when a problem occurs

# RGBInvalidValueException

Compatibility
Framework LeoCorpLibrary LeoCorpLibrary.Core
.NET 5
.NET Core 3.1
.NET Framework 4.7.2
.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")

Go to top

# HEXInvalidValueException

Compatibility
Framework LeoCorpLibrary LeoCorpLibrary.Core
.NET 5
.NET Core 3.1
.NET Framework 4.7.2
.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")

Go to top

# GuidGenerator

# InvalidGuidLenghtException

Compatibility
Framework LeoCorpLibrary LeoCorpLibrary.Core
.NET 5
.NET Core 3.1
.NET Framework 4.7.2
.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.InvalidGuidLenghtException

Here's an example of usage:

C#

throw new InvalidGuidLenghtException("Message here");

VB

Throw New InvalidGuidLenghtException("Message here")

Go to top