Skip to content

Commit da992a8

Browse files
committed
Fix catching 404 error from GH API
1 parent 2e953b4 commit da992a8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

webapp/publisher/cve/cve_views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from webapp.helpers import api_publisher_session
55
from webapp.decorators import login_required
66
from webapp.publisher.cve.cve_helper import CveHelper
7+
from werkzeug.exceptions import NotFound
78

89
dashboard = Dashboard(api_publisher_session)
910

@@ -52,7 +53,10 @@ def has_cves(snap_name):
5253
status_code,
5354
)
5455

55-
snap_has_cves = CveHelper.has_cve_data(snap_name)
56+
try:
57+
snap_has_cves = CveHelper.has_cve_data(snap_name)
58+
except NotFound:
59+
snap_has_cves = False
5660
if snap_has_cves:
5761
return flask.jsonify({"success": True})
5862
else:

0 commit comments

Comments
 (0)