Creating your own errors

    You can use the command to create your own error messages. For example, let’s say you had your own command called and you wanted to give an error back to the caller about something wrong with a parameter that was passed in.

    Next, you can create an error using the command. This command takes in a record that describes the error to create:

    When called with a value, we’ll now see an error message returned: