Skip to content
Snippets Groups Projects
Commit 06c9c871 authored by akiraohgaki's avatar akiraohgaki
Browse files

Show exception message

parent 477470db
Branches
Tags
No related merge requests found
......@@ -260,7 +260,6 @@ class XdgUrl:
print('Done')
def execute(self):
try:
if (self.meta['command'] in ['download', 'install']
and self.meta['url']
and self.meta['type'] in self.destinations
......@@ -269,12 +268,8 @@ class XdgUrl:
self.download()
elif self.meta['command'] == 'install':
self.install()
return True
print('Incorrect XDG-URL ' + self.xdg_url)
return False
except:
print('Execution error')
return False
else:
raise Exception('Incorrect XDG-URL ' + self.xdg_url)
'''
class XdgUrlApp(Tkinter.Frame):
......@@ -333,10 +328,17 @@ if __name__ == '__main__':
window.withdraw()
if tkMessageBox.askyesno('xdgurl', info_text + '\n\nDo you want to continue?'):
if core.execute():
tkMessageBox.showinfo('xdgurl', info_text + '\n\n' + execute_text + ' finished')
try:
core.execute();
except Exception as e:
message = ''
if e.message:
message = e.message
else:
tkMessageBox.showerror('xdgurl', info_text + '\n\n' + execute_text + ' failed')
message = str(e)
tkMessageBox.showerror('xdgurl', info_text + '\n\n' + execute_text + ' failed\n' + message)
else:
tkMessageBox.showinfo('xdgurl', info_text + '\n\n' + execute_text + ' finished')
sys.exit()
else:
print('xdgurl "XDG-URL"')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment