aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-14 23:27:17 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-14 23:27:17 +0300
commit7620c0338c7bc9050f5eae58ce6ee5bb8cf42fc4 (patch)
tree8835eb4ccae1d583c10130a4a233faada472a626 /servo/views
parentd7f137a7f32a987f6b921e48e441b884129b9cc3 (diff)
downloadServo-7620c0338c7bc9050f5eae58ce6ee5bb8cf42fc4.tar.gz
Servo-7620c0338c7bc9050f5eae58ce6ee5bb8cf42fc4.tar.bz2
Servo-7620c0338c7bc9050f5eae58ce6ee5bb8cf42fc4.zip
Catch GsxError in repair details
Diffstat (limited to 'servo/views')
-rw-r--r--servo/views/gsx.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/servo/views/gsx.py b/servo/views/gsx.py
index ce2ad1d..d8e1083 100644
--- a/servo/views/gsx.py
+++ b/servo/views/gsx.py
@@ -322,10 +322,17 @@ def repair_details(request, confirmation):
"""
Returns GSX repair details for confirmation number
"""
- repair = RepairDetails(confirmation)
+ try:
+ repair = RepairDetails(confirmation)
+ except Exception as e:
+ data = {'error': e}
+ return render(request, "snippets/error_modal.html", data)
+
data = {'repair': repair}
+
if request.method == "POST":
data = save_repair(request, data)
+
return render(request, "repairs/get_details.html", data)