def formatError(error):
    """
    Format an error as a string. Write the error type as prefix.
    Eg. "[ValueError] invalid value".
    """
    return '[%s] %s' % (error.__class__.__name__, error)
