Namespace Errs
Classes
Err
Is the exception class with a reason.
This class has a property which indicates a reason for this exception. Typically the type of
this property is a record class. In this case, the class name of this record represents
the reason, and the fields of the record hold the situation where the exception occurred.
Optionally, this exception class can notify its instance creation to pre-registered exception
handlers. This notification feature can be enabled by specifying the command line argument
{@code --github.sttk.errs.notify=true} when an application using this library is started.
public record FailToDoSomething(String name, int value);
try
{
throw new Err(new FailToDoSomething("abc", 123));
}
catch (Err e)
{
Console.WriteLine(e.Message);
}
Delegates
AsyncErrHandler
Is a handler that asynchronously handles an Err object when it is created.
SyncErrHandler
Is a handler that synchronously handles an Err object when it is created.