mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
improve the error reporting when a ui fails to load
This commit is contained in:
parent
eaf8183397
commit
e12faf5641
1 changed files with 12 additions and 4 deletions
|
@ -22,7 +22,6 @@
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
import sys
|
|
||||||
import deluge.configmanager
|
import deluge.configmanager
|
||||||
|
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
@ -62,6 +61,15 @@ class UI:
|
||||||
from deluge.ui.console.main import ConsoleUI
|
from deluge.ui.console.main import ConsoleUI
|
||||||
ui = ConsoleUI(ui_args).run()
|
ui = ConsoleUI(ui_args).run()
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
log.exception(e)
|
import sys
|
||||||
log.error("Unable to start the requested UI: %s. Please examine the above traceback for more information on what you're missing. You may also select a different UI with the '-u' option or alternatively use the '-s' option to select a different default UI.", selected_ui)
|
import traceback
|
||||||
sys.exit(0)
|
error_type, error_value, tb = sys.exc_info()
|
||||||
|
stack = traceback.extract_tb(tb)
|
||||||
|
last_frame = stack[-1]
|
||||||
|
if last_frame[0] == __file__:
|
||||||
|
log.error("Unable to find the requested UI: %s. Please select a different UI with the '-u' option or alternatively use the '-s' option to select a different default UI.", selected_ui)
|
||||||
|
else:
|
||||||
|
log.exception(e)
|
||||||
|
log.error("There was an error whilst launching the request UI: %s", selected_ui)
|
||||||
|
log.error("Look at the traceback above for more information.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue