diff --git a/gitlab.py b/gitlab.py index 8d87de0..1cf4a41 100644 --- a/gitlab.py +++ b/gitlab.py @@ -31,6 +31,10 @@ def getMRsWaitingForMyApproval(): result = requests.get(url, verify=False, headers={'PRIVATE-TOKEN': args.token}) + + if result.status_code != 200: + exit('Can not access merge requests list. Reposnse code: ' + str(result.status_code)) + try: data = result.json() except: @@ -77,4 +81,4 @@ def do_GET(self): with socketserver.TCPServer(("127.0.0.1", PORT), MyHandler) as httpd: print('serving a GET at "http://localhost:%4d"' %(PORT)) - httpd.serve_forever() \ No newline at end of file + httpd.serve_forever()