summaryrefslogtreecommitdiff
path: root/gerbonara/cad/protoserve.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerbonara/cad/protoserve.py')
-rw-r--r--gerbonara/cad/protoserve.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gerbonara/cad/protoserve.py b/gerbonara/cad/protoserve.py
index bcd48ce..25ef8c6 100644
--- a/gerbonara/cad/protoserve.py
+++ b/gerbonara/cad/protoserve.py
@@ -4,7 +4,7 @@ import importlib.resources
from tempfile import NamedTemporaryFile, TemporaryDirectory
from pathlib import Path
-from quart import Quart, request, Response, send_file
+from quart import Quart, request, Response, send_file, abort
from . import protoboard as pb
from . import protoserve_data
@@ -144,7 +144,10 @@ def to_board(obj):
mounting_hole_offset = float(holes.get('offset', unit(5, MM)))
if obj.get('children'):
- content = deserialize(obj['children'][0], unit)
+ try:
+ content = deserialize(obj['children'][0], unit)
+ except ValueError:
+ return abort(400)
else:
content = [pb.EmptyProtoArea()]