You should use a try-except keyword to capture the error and use the raise keyword to display the error message of your choice. Here's an example demonstrating the same:

    a = int(input())
    raise Exception('An error is being raised in the system')

BY Best Interview Question ON 19 Jun 2020