Make totpcgi log errors
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
parent
639bbc3e0f
commit
e898e9a320
1 changed files with 12 additions and 1 deletions
|
@ -190,4 +190,15 @@ def cgimain():
|
|||
sys.stdout.write(success_string)
|
||||
|
||||
if __name__ == '__main__':
|
||||
cgimain()
|
||||
try:
|
||||
cgimain()
|
||||
except Exception:
|
||||
logging.exception("Server error during processing")
|
||||
output = 'ERR\nInternal server error\n'
|
||||
sys.stdout.write('Status: 500 SERVER ERROR\n')
|
||||
sys.stdout.write('Content-type: text/plain\n')
|
||||
sys.stdout.write('Content-Length: %s\n' % len(output))
|
||||
sys.stdout.write('\n')
|
||||
|
||||
sys.stdout.write(output)
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue