def error(context, *infos):
    """Print a brief error message and return an error code."""
    messages = ["An error occurred when when " + context + ":"]
    messages.extend(infos)
    print("\n\t".join(map(str, messages)))
    return 1