Univention Bugzilla – Attachment 10166 Details for
Bug 46790
Better error messages for activation wizard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch (fbest/46790-acivation-error-handling)
46790.patch (text/plain), 2.74 KB, created by
Florian Best
on 2019-08-27 15:33:42 CEST
(
hide
)
Description:
patch (fbest/46790-acivation-error-handling)
Filename:
MIME Type:
Creator:
Florian Best
Created:
2019-08-27 15:33:42 CEST
Size:
2.74 KB
patch
obsolete
>diff --git a/base/univention-system-activation/src/wsgi.py b/base/univention-system-activation/src/wsgi.py >index 2631fcaf5a..ccc98b52d3 100644 >--- a/base/univention-system-activation/src/wsgi.py >+++ b/base/univention-system-activation/src/wsgi.py >@@ -2,6 +2,7 @@ > > import cgi > import subprocess >+import traceback > import json > import re > from ldif import LDIFParser >@@ -69,7 +70,13 @@ def clean_license_output(out): > > > def application(environ, start_response): >- """WSGI entry point""" >+ def _error(message, trace=None): >+ return { >+ 'status': 500, >+ 'message': message, >+ 'traceback': trace, >+ 'location': '', >+ } > > def _log(msg): > print >> environ['wsgi.errors'], msg >@@ -91,7 +98,9 @@ def application(environ, start_response): > return _finish(data=out) > except subprocess.CalledProcessError as exc: > _log('Failed to read license data from LDAP:\n%s' % exc) >- return _finish('400 Bad Request', 'Failed to read license data from LDAP:\n%s' % exc) >+ return _finish('500 Internal Server Error', _error('Failed to read license data from LDAP:\n%s' % exc)) >+ except Exception as exc: >+ return _finish(data=_error(str(exc), traceback.format_exc())) > > # block uploads that are larger than 1MB > try: >diff --git a/base/univention-system-activation/www/ActivationWizard.js b/base/univention-system-activation/www/ActivationWizard.js >index ebf0047862..5e7b98afbc 100644 >--- a/base/univention-system-activation/www/ActivationWizard.js >+++ b/base/univention-system-activation/www/ActivationWizard.js >@@ -44,9 +44,8 @@ define([ > "umc/widgets/Text", > "umc/widgets/TextBox", > "put-selector/put", >- "umc/json!/license", > "umc/i18n!systemactivation" >-], function(declare, lang, array, Deferred, ioQuery, domQuery, request, xhr, script, Uploader, dialog, Wizard, Text, TextBox, put, license, _) { >+], function(declare, lang, array, Deferred, ioQuery, domQuery, request, xhr, script, Uploader, dialog, Wizard, Text, TextBox, put, _) { > return declare("ActivationWizard", [ Wizard ], { > autoFocus: true, > entries: null, >@@ -201,16 +200,20 @@ define([ > emailNode.innerHTML = email_address; > > // send the email >- var data = { >- email: email_address, >- licence: license >- }; >- return xhr.post('https://license.univention.de/keyid/conversion/submit', { >- data: data, >- handleAs: 'text', >- headers: { >- 'X-Requested-With': null >- } >+ xhr.get('/license', { handleAs: 'json' }).then(function(license) { >+ var data = { >+ email: email_address, >+ licence: license >+ }; >+ return xhr.post('https://license.univention.de/keyid/conversion/submit', { >+ data: data, >+ handleAs: 'text', >+ headers: { >+ 'X-Requested-With': null >+ } >+ }); >+ }, function(error) { >+ tools.handleErrorStatus(error); > }); > }, >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46790
: 10166 |
10177