UniversalDevicesInc-PG3 / udi-poly-Airthings-Consumer

Polyglot V3 Node Server for Airthings Consumer API
0 stars 0 forks source link

Properly trap errors #3

Closed jimboca closed 2 years ago

jimboca commented 2 years ago

This likely happened because I used the same app for dev and production so both were polling?

2022-07-03 20:52:17,977 Thread-83  udi_interface      DEBUG    pgSession:response:  Got: code=429
2022-07-03 20:52:17,978 Thread-83  udi_interface      DEBUG    pgSession:response:       text={"error":"TOO_MANY_REQUESTS","error_description":"Rate limit on API exceeded","error_code":1070}
2022-07-03 20:52:17,979 Thread-83  udi_interface      ERROR    pgSession:response: Unknown response 429: https://ext-api.airthings.com/v1//devices/2930024814/latest-samples {"error":"TOO_MANY_REQUESTS","error_description":"Rate limit on API exceeded","error_code":1070}

2022-07-03 20:52:17,980 Thread-83  udi_interface      DEBUG    Controller:api_get: res={'code': 429, 'data': {'error': 'TOO_MANY_REQUESTS', 'error_description': 'Rate limit on API exceeded', 'error_code': 1070}}
jimboca commented 2 years ago

This one should also set authroized=False

2022-07-03 23:59:20,190 Thread-504 udi_interface      DEBUG    pgSession:response:  Got: code=401
2022-07-03 23:59:20,191 Thread-504 udi_interface      DEBUG    pgSession:response:       text={"message":"Unauthorized"}
2022-07-03 23:59:20,192 Thread-504 udi_interface      ERROR    pgSession:response: Unauthorized: https://ext-api.airthings.com/v1//devices/2930024814/latest-samples: text: {"message":"Unauthorized"}
2022-07-03 23:59:20,193 Thread-504 udi_interface      DEBUG    Controller:api_get: res={'code': 401, 'data': {'message': 'Unauthorized'}}