Show error response body on HTTP failures, v1.0.12
This commit is contained in:
@@ -19,7 +19,8 @@ class HttpClient:
|
||||
def post(self, path, data=None, **kwargs):
|
||||
kwargs.setdefault("timeout", 30)
|
||||
r = self._session.post(f"{self._endpoint}{path}", json=data, **kwargs)
|
||||
r.raise_for_status()
|
||||
if not r.ok:
|
||||
raise Exception(f"{r.status_code} {r.reason}: {r.text[:200]}")
|
||||
result = {}
|
||||
try:
|
||||
result = r.json()
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ from routes.main import bp as main_bp
|
||||
from routes.api import bp as api_bp
|
||||
from routes.api_test import bp as api_test_bp
|
||||
|
||||
VERSION = "1.0.11"
|
||||
VERSION = "1.0.12"
|
||||
|
||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
||||
|
||||
Reference in New Issue
Block a user