Defines a custom exception type ActionRefusal deriving from InvalidOperationException and a helper static class ActionRefusalRules with IsRefusal to check if an Exception is an ActionRefusal.
using System;
namespace TeamCreate;
public sealed class ActionRefusal : InvalidOperationException
{
public ActionRefusal(string message)
: base(message)
{
}
}
public static class ActionRefusalRules
{
public static bool IsRefusal(Exception error)
{
return error is ActionRefusal;
}
}