During method execution, it is sometimes necessary to abort the processing because the action that's requested by the user isn't valid or an error condition has been met. This recipe shows you how to manage these cases by showing a helpful error message.
Reporting errors to the user
Getting ready
This recipe assumes that you have an instance ready, with the my_library add-on module available, as described in the previous recipe.
How to do it...
We will make a change in the change_state method from the previous recipe and display a helpful message when the user...