Skip to content

Commit

Permalink
Updated status code exclusion in observer to 401 (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonKirill authored Dec 11, 2024
1 parent c3fa7b2 commit 9c286ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/klatchat_observer/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import http
import json
import re
import time
Expand Down Expand Up @@ -829,7 +830,7 @@ def _fetch_klat_server(self, url: str) -> Response:
response = self._send_get_request_to_klat(url=url)
if response.ok:
return response
elif response.status_code != 403:
elif response.status_code != http.HTTPStatus.UNAUTHORIZED.value:
raise KlatAPIAuthorizationError("Klat API unavailable")
self._login_to_klat_server()
return self._send_get_request_to_klat(url=url)
Expand Down

0 comments on commit 9c286ed

Please sign in to comment.