From 5477a7d54849181b3d988c829623b28ac64a4421 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 3 Nov 2016 15:46:49 +0300 Subject: [PATCH] profile creation - saving exception --- toxygen/main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/toxygen/main.py b/toxygen/main.py index 430a757..de6dea2 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -138,7 +138,18 @@ class Toxygen: path = Settings.get_default_path() else: path = curr_directory() + '/' - ProfileHelper(path, name).save_profile(self.tox.get_savedata()) + try: + ProfileHelper(path, name).save_profile(self.tox.get_savedata()) + except Exception as ex: + print(str(ex)) + log('Profile creation exception: ' + str(ex)) + msgBox = QtGui.QMessageBox() + msgBox.setText(QtGui.QApplication.translate("login", + 'Profile saving error! Does Toxygen have permission to write to this directory?', + None, + QtGui.QApplication.UnicodeUTF8)) + msgBox.exec_() + return path = Settings.get_default_path() settings = Settings(name) if curr_lang in langs: