<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check(cls, status):
 """Checks if a status enum matches the trigger originally set, and if so, raises the appropriate error. Args: status (int, enum):
 A protobuf enum response status to check. Raises: AssertionError: If trigger or error were not set. _ApiError: If the statuses don't match. Do not catch. Will be caught automatically and sent back to the client. """

        assert cls.trigger is not None, 'Invalid ErrorTrap, trigger not set'
        assert cls.error is not None, 'Invalid ErrorTrap, error not set'

        if status == cls.trigger:
            # pylint: disable=not-callable
            # cls.error will be callable at runtime
            raise cls.error()