diff --git a/app/redirectShortenURL.py b/app/redirectShortenURL.py
index 13069842190972e5e8636489d2d34db910341d09..b4fb0094cf39fca4873bc0c26f43581af7f24775 100644
--- a/app/redirectShortenURL.py
+++ b/app/redirectShortenURL.py
@@ -9,16 +9,12 @@ def redirect_shorten_url(request, short_url):
with connect('db/urls.db') as conn: #Get the original URL from the database
cursor = conn.cursor()
res = cursor.execute('SELECT LONG_URL FROM WEB_URL WHERE SHORT_URL=?', [host + "/" + short_url.lower()])
- try:
- short = res.fetchone()
- if short is not None: #If a long url is found
- url = short[0]
- error_404 = False
- else:
- error_404 = True #If no url is found throw a 404. If you throw a error in a try / catch block it will be catched by this, so set a variable to true and throw the error later
- except Exception as e: #If there happens an error, print the exception to the console and throw a 500 error
- print(e) #Print a debug Message to the console
- abort(500)
+ short = res.fetchone()
+ if not short is None: #If a long url is found
+ url = short[0]
+ error_404 = False
+ else:
+ error_404 = True #If no url is found throw a 404. If you throw a error in a try / catch block it will be catched by this, so set a variable to true and throw the error later
if not error_404: #If there was no 404 error before, redirect the user. If not throw a 404 error
res = cursor.execute('SELECT CALLS FROM ANALYTICS WHERE SHORT_URL=?', [host + "/" + short_url.lower()])
row = row = cursor.fetchone()