Skip to content

Commit

Permalink
Improve 404
Browse files Browse the repository at this point in the history
  • Loading branch information
wiresio committed Nov 19, 2024
1 parent a250f75 commit df514bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tdd/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import subprocess
import json
import re
from flask import Response
from flask import Response, abort


from tdd.sparql import (
Expand Down Expand Up @@ -136,5 +136,6 @@ def get_id_description(uri, content_type, ontology):
if not resp.text.strip() or not (
re.search(r"^[^\#]", resp.text, re.MULTILINE)
): # because some SPARQL endpoint may send "# Empty file" as response
raise IDNotFound()
#raise IDNotFound()
abort(404)
return resp.text
2 changes: 1 addition & 1 deletion tdd/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def __init__(self, ld_content):


class IDNotFound(AppException):
title = "ID Not Found"
title = "Not found"
status_code = 404


Expand Down

0 comments on commit df514bf

Please sign in to comment.