def METHOD_NAME(fileobj, version='1.1.1'):
    try:
        return wmsparse.METHOD_NAME(fileobj)
    except ValueError as ex:
        log_error('%s\n%s\n%s\n%s\nNot a capabilities document: %s', 'Recieved document:', '-'*80, fileobj.getvalue(), '-'*80, ex.args[0])
        sys.exit(1)
    except etree.ElementTree.ParseError as ex:
        log_error('%s\n%s\n%s\n%s\nCould not parse the document: %s', 'Recieved document:', '-'*80, fileobj.getvalue(), '-'*80, ex.args[0])
        sys.exit(1)