How to create Custom Exception class?

Hello expert,
UiPath has new workflow called “Coded WorkFlow”, using that how to create Custom exception class called “UserNotFoundException”, so that i can use this in throw activity as “new UserNotFoundExcepotion(“User is not valid”)”.

Thanks in advance.

had you tried:

using System;

public class UserNotFoundException: Exception
{
    public UserNotFoundException()
    {
    }

    public UserNotFoundException(string message)
        : base(message)
    {
    }

    public UserNotFoundException(string message, Exception inner)
        : base(message, inner)
    {
    }
}

assumed you want to inherit from exception

Should i use this in CodedWorkflow or coded File ?