def check_err(code):
    "Checks the given OGRERR, and raises an exception where appropriate."
    
    if code == OGRERR_NONE:
        return
    elif code in OGRERR_DICT:
        e, msg = OGRERR_DICT[code]
        raise e, msg
    else:
        raise OGRException(code % 'Unknown error code: "%s"')
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/contrib/gis/gdal/error.py/check_err/swapped operands of `%`