<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def croak(error, message_writer=message):
 """Throw an exception in the Maltego GUI containing error_msg."""

    if isinstance(error, MaltegoException):
        message_writer(MaltegoTransformExceptionMessage(exceptions=[error]))
    else:
        message_writer(MaltegoTransformExceptionMessage(exceptions=[MaltegoException(error)]))