Skip to content
Snippets Groups Projects
Verified Commit e9931086 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible: web scheduler: print debug info also in case of ValidationError


Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 9034bf1e
No related merge requests found
......@@ -12,13 +12,22 @@ import subprocess
cgitb.enable()
def debug_info():
# Debug info, to be removed once ready to go.
print()
print('WARNING: This endpoint is still a WORK IN PROGRESS. This means that the option details can change, and it will not commit any change.')
print('You are aunthenticated as: {}'.format(user))
print(cgi.FieldStorage())
class ValidationError(Exception):
def __init__(self, message):
super().__init__(message)
print('Status: 400 Bad Request')
print('Content-Type: text/html; charset="utf-8"')
print('Content-Type: text/plain; charset="utf-8"')
print()
print(message)
debug_info()
sys.exit()
......@@ -131,8 +140,4 @@ else:
print()
cgitb.handler()
# Debug info, to be removed once ready to go.
print()
print('WARNING: This endpoint is still a WORK IN PROGRESS. This means that the option details can change, and it will not commit any change.')
print('You are aunthenticated as: {}'.format(user))
print(cgi.FieldStorage())
debug_info()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment