]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:loud_sound: Log body parsing errors
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 10 Dec 2018 13:54:53 +0000 (17:54 +0400)
committerSebastián Ramírez <tiangolo@gmail.com>
Mon, 10 Dec 2018 13:54:53 +0000 (17:54 +0400)
fastapi/__init__.py
fastapi/openapi/models.py
fastapi/routing.py

index d27c0eab7e055896e73b914cbf65f79188db1371..1275415fae108e99b28a86928848b4f57d9886b9 100644 (file)
@@ -1,6 +1,6 @@
 """FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
 
-__version__ = "0.1.4"
+__version__ = "0.1.5"
 
 from .applications import FastAPI
 from .routing import APIRouter
index eb49dc96b3a7f4dd007159310e277d9a71db1cbc..7cdee02a4e228abb62fa995f61a79bcb7a0d77c0 100644 (file)
@@ -10,9 +10,10 @@ try:
     from pydantic.types import EmailStr  # type: ignore
 except ImportError:
     logging.warning(
-        "email-validator not installed, email fields will be treated as str.\n" +
-        "To install, run: pip install email-validator"
+        "email-validator not installed, email fields will be treated as str.\n"
+        "To install, run: pip install email-validator"
     )
+
     class EmailStr(str):  # type: ignore
         pass
 
index 6349fa9b6f96c2a6bdb8f22ce4edc81d4dc3f52f..57ed655cb984e140bc3005bc14c2c248f7336cd9 100644 (file)
@@ -61,7 +61,8 @@ def get_app(
                             body[field] = value
                 else:
                     body = await request.json()
-        except Exception:
+        except Exception as e:
+            logging.error("Error getting request body", e)
             raise HTTPException(
                 status_code=400, detail="There was an error parsing the body"
             )