fix error handling by non-standard GitHub responses to invalid Bearer tokens