def detector(error):
    """
    Pass this the error message and it returns a lambda function that you can pass a
    string. Returns ``True`` if the string occurs in the error message, ``False``
    otherwise.
    """
    return lambda trigger: error.lower().find(trigger) != -1