<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main():
 """Main script handler. Returns: int: 0 for success, >1 error code """

    logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s')

    try:
        cli()
        return 0
    except LocationsError as error:
        print(error)
        return 2
    except RuntimeError as error:
        print(error)
        return 255
    except OSError as error:
        return error.errno