fix: JSONDecodeError when view post

This commit is contained in:
firedotguy
2026-02-06 21:43:03 +03:00
parent 55630bc23f
commit a2d019e1d6

View File

@@ -790,6 +790,8 @@ class Client:
NotFound: Пост не найден NotFound: Пост не найден
""" """
res = view_post(self.token, id) res = view_post(self.token, id)
if res.status_code == 204:
return
if res.json().get('error', {}).get('code') == 'NOT_FOUND': if res.json().get('error', {}).get('code') == 'NOT_FOUND':
raise NotFound('Post') raise NotFound('Post')
res.raise_for_status() res.raise_for_status()