Add more error messages encouraging bug reports
CHANGELOG.md
11 | 11 | * The internals have been refactored. The most visible difference is in | |
12 | 12 | settings handling: systems define the settings they need, instead of having | |
13 | 13 | this information spread everywhere. | |
14 | + | * When a crash happens, suggest sending a bug report and show traceback. Obviously, | |
15 | + | it would be much better to fix the actual crashes :-) | |
14 | 16 | ||
15 | 17 | ### Bug fixes ### | |
16 | 18 |
offlate/data/common.py unknown status 1
1 | + | REPO = 'https://framagit.org/tyreunom/offlate/issues' | |
2 | + | EMAIL = 'bug-offlate@lepiller.eu' |
offlate/locales/offlate_en.ts
3 | 3 | <context> | |
4 | 4 | <name>AboutWindow</name> | |
5 | 5 | <message> | |
6 | - | <location filename="../ui/about.py" line="43"/> | |
6 | + | <location filename="../ui/about.py" line="45"/> | |
7 | 7 | <source>Offlate is a translation interface for offline translation of projects using online platforms. Offlate is free software, you can redistribute it under the GPL v3 license or any later version.</source> | |
8 | 8 | <translation>Offlate is a translation interface for offline translation of projects using online platforms. Offlate is free software, you can redistribute it under the GPL v3 license or any later version.</translation> | |
9 | 9 | </message> | |
… | |||
13 | 13 | <translation type="obsolete">Copyright ?? 2018, 2019 Julien Lepiller</translation> | |
14 | 14 | </message> | |
15 | 15 | <message> | |
16 | - | <location filename="../ui/about.py" line="51"/> | |
16 | + | <location filename="../ui/about.py" line="53"/> | |
17 | 17 | <source>Report an issue</source> | |
18 | 18 | <translation>Report an issue</translation> | |
19 | 19 | </message> | |
20 | 20 | <message> | |
21 | - | <location filename="../ui/about.py" line="52"/> | |
21 | + | <location filename="../ui/about.py" line="54"/> | |
22 | 22 | <source>Close this window</source> | |
23 | 23 | <translation>Close this window</translation> | |
24 | 24 | </message> | |
25 | 25 | <message> | |
26 | - | <location filename="../ui/about.py" line="49"/> | |
26 | + | <location filename="../ui/about.py" line="51"/> | |
27 | 27 | <source>Copyright (C) 2018-2021 Julien Lepiller</source> | |
28 | 28 | <translation type="unfinished"></translation> | |
29 | 29 | </message> | |
… | |||
584 | 584 | </message> | |
585 | 585 | </context> | |
586 | 586 | <context> | |
587 | + | <name>dialog</name> | |
588 | + | <message> | |
589 | + | <location filename="../ui/main.py" line="59"/> | |
590 | + | <source>The app just crashed, please report thefollowing error, with any relevant information (what you didwhen the app crashed, any external factor that might be relevant,etc.). You can send your report on {}, or by email to {}. | |
591 | + | ||
592 | + | {} | |
593 | + | Traceback: | |
594 | + | {}</source> | |
595 | + | <translation type="unfinished"></translation> | |
596 | + | </message> | |
597 | + | </context> | |
598 | + | <context> | |
587 | 599 | <name>self.parent</name> | |
588 | 600 | <message> | |
589 | - | <location filename="../ui/parallel.py" line="52"/> | |
601 | + | <location filename="../ui/parallel.py" line="57"/> | |
590 | 602 | <source>A project with the same name already exists. The new project was not created. You should first remove the same-named project.</source> | |
591 | 603 | <translation>A project with the same name already exists. The new project was not created. You should first remove the same-named project.</translation> | |
592 | 604 | </message> | |
593 | 605 | <message> | |
594 | - | <location filename="../ui/parallel.py" line="56"/> | |
606 | + | <location filename="../ui/parallel.py" line="61"/> | |
595 | 607 | <source>Your filesystem contains a same-named directory for your new project. The new project was not created. You should first remove the same-named directory: "{}".</source> | |
596 | 608 | <translation>Your filesystem contains a same-named directory for your new project. The new project was not created. You should first remove the same-named directory: ???{}???.</translation> | |
597 | 609 | </message> | |
598 | 610 | <message> | |
599 | - | <location filename="../ui/parallel.py" line="62"/> | |
611 | + | <location filename="../ui/parallel.py" line="67"/> | |
600 | 612 | <source>The project you added uses the {} format, but it is not supported yet by Offlate. You can try to update the application, or if you are on the latest version already, report it as a bug.</source> | |
601 | 613 | <translation>The project you added uses the {} format, but it is not supported yet by Offlate. You can try to update the application, or if you are on the latest version already, report it as a bug.</translation> | |
602 | 614 | </message> | |
603 | 615 | <message> | |
604 | - | <location filename="../ui/parallel.py" line="70"/> | |
616 | + | <location filename="../ui/parallel.py" line="75"/> | |
605 | 617 | <source>An unexpected error occured while fetching the project: {}. You should report this as a bug.</source> | |
606 | 618 | <translation>An unexpected error occured while fetching the project: {}. You should report this as a bug.</translation> | |
607 | 619 | </message> | |
608 | 620 | <message> | |
609 | - | <location filename="../ui/parallel.py" line="66"/> | |
621 | + | <location filename="../ui/parallel.py" line="71"/> | |
610 | 622 | <source>The project {} you added could not be found in the translation platform you selected. Did you make a typo while entering the name or other parameters?</source> | |
611 | 623 | <translation>The project {} you added could not be found in the translation platform you selected. Did you make a typo while entering the name or other parameters?</translation> | |
612 | 624 | </message> | |
613 | 625 | <message> | |
614 | - | <location filename="../ui/parallel.py" line="46"/> | |
615 | - | <source>This action did not complete correctly. We received the following error message: {}. | |
626 | + | <location filename="../ui/parallel.py" line="48"/> | |
627 | + | <source>This action did not complete correctly. Try again, and if the issue persists, consider sending a bug report at {}, or by email to {} with the following information, and any relevant information (what you were trying to do, other external factors, etc.) We received the following error message: {}. | |
616 | 628 | ||
617 | 629 | Traceback: | |
618 | 630 |
offlate/locales/offlate_fr.ts
3 | 3 | <context> | |
4 | 4 | <name>AboutWindow</name> | |
5 | 5 | <message> | |
6 | - | <location filename="../ui/about.py" line="43"/> | |
6 | + | <location filename="../ui/about.py" line="45"/> | |
7 | 7 | <source>Offlate is a translation interface for offline translation of projects using online platforms. Offlate is free software, you can redistribute it under the GPL v3 license or any later version.</source> | |
8 | 8 | <translation>Offlate est une interface de traduction hors-ligne de projets qui utilisent des plateformes en ligne. Offlate est un logiciel libre, vous pouvez le redistribuer sous la licence GPL v3 ou toute version ult??rieure.</translation> | |
9 | 9 | </message> | |
10 | 10 | <message> | |
11 | - | <location filename="../ui/about.py" line="51"/> | |
11 | + | <location filename="../ui/about.py" line="53"/> | |
12 | 12 | <source>Report an issue</source> | |
13 | 13 | <translation>Rapporter un probl??me</translation> | |
14 | 14 | </message> | |
15 | 15 | <message> | |
16 | - | <location filename="../ui/about.py" line="52"/> | |
16 | + | <location filename="../ui/about.py" line="54"/> | |
17 | 17 | <source>Close this window</source> | |
18 | 18 | <translation>Fermer cette fen??tre</translation> | |
19 | 19 | </message> | |
… | |||
25 | 25 | Copyright ?? 2018, 2019 Julien Lepiller</translation> | |
26 | 26 | </message> | |
27 | 27 | <message> | |
28 | - | <location filename="../ui/about.py" line="49"/> | |
28 | + | <location filename="../ui/about.py" line="51"/> | |
29 | 29 | <source>Copyright (C) 2018-2021 Julien Lepiller</source> | |
30 | 30 | <translation type="unfinished"></translation> | |
31 | 31 | </message> | |
… | |||
586 | 586 | </message> | |
587 | 587 | </context> | |
588 | 588 | <context> | |
589 | + | <name>dialog</name> | |
590 | + | <message> | |
591 | + | <location filename="../ui/main.py" line="59"/> | |
592 | + | <source>The app just crashed, please report thefollowing error, with any relevant information (what you didwhen the app crashed, any external factor that might be relevant,etc.). You can send your report on {}, or by email to {}. | |
593 | + | ||
594 | + | {} | |
595 | + | Traceback: | |
596 | + | {}</source> | |
597 | + | <translation type="unfinished"></translation> | |
598 | + | </message> | |
599 | + | </context> | |
600 | + | <context> | |
589 | 601 | <name>self.parent</name> | |
590 | 602 | <message> | |
591 | - | <location filename="../ui/parallel.py" line="52"/> | |
603 | + | <location filename="../ui/parallel.py" line="57"/> | |
592 | 604 | <source>A project with the same name already exists. The new project was not created. You should first remove the same-named project.</source> | |
593 | 605 | <translation>Il existe d??j?? un projet avec le m??me nom. Le nouveau projet n'a pas ??t?? cr????. Vous devriez supprimer le projet qui a le m??me nom.</translation> | |
594 | 606 | </message> | |
595 | 607 | <message> | |
596 | - | <location filename="../ui/parallel.py" line="56"/> | |
608 | + | <location filename="../ui/parallel.py" line="61"/> | |
597 | 609 | <source>Your filesystem contains a same-named directory for your new project. The new project was not created. You should first remove the same-named directory: "{}".</source> | |
598 | 610 | <translation>Votre syst??me de fichiers contient d??j?? un r??pertoire avec le m??me nom que votre nouveau projet. Le nouveau projet n'a pas ??t?? cr????. Vous devriez d'abord supprimer le r??pertoire avec le m??me nom : ?? {} ??.</translation> | |
599 | 611 | </message> | |
600 | 612 | <message> | |
601 | - | <location filename="../ui/parallel.py" line="62"/> | |
613 | + | <location filename="../ui/parallel.py" line="67"/> | |
602 | 614 | <source>The project you added uses the {} format, but it is not supported yet by Offlate. You can try to update the application, or if you are on the latest version already, report it as a bug.</source> | |
603 | 615 | <translation>Le projet que vous avez ajout?? utilise le format {}, mais il n'est pas encore pris en charge par Offlate. Vous pouvez essayer de mettre ?? jour l'application, ou si vous ??tes d??j?? sur la derni??re version, rapportez un bogue.</translation> | |
604 | 616 | </message> | |
605 | 617 | <message> | |
606 | - | <location filename="../ui/parallel.py" line="70"/> | |
618 | + | <location filename="../ui/parallel.py" line="75"/> | |
607 | 619 | <source>An unexpected error occured while fetching the project: {}. You should report this as a bug.</source> | |
608 | 620 | <translation>Une erreur inattendue a eu lieue lors de la r??cup??ration du projet : {}. Vous devriez rapporter un bogue.</translation> | |
609 | 621 | </message> | |
610 | 622 | <message> | |
611 | - | <location filename="../ui/parallel.py" line="66"/> | |
623 | + | <location filename="../ui/parallel.py" line="71"/> | |
612 | 624 | <source>The project {} you added could not be found in the translation platform you selected. Did you make a typo while entering the name or other parameters?</source> | |
613 | 625 | <translation>Le projet {} que vous avez ajout?? n'a pas ??t?? trouv?? sur la plateforme de traduction de vous avez choisie. Avez-vous fait une coquille en tapant son nom ou d'autres param??tres ?</translation> | |
614 | 626 | </message> | |
615 | 627 | <message> | |
616 | - | <location filename="../ui/parallel.py" line="46"/> | |
617 | - | <source>This action did not complete correctly. We received the following error message: {}. | |
628 | + | <location filename="../ui/parallel.py" line="48"/> | |
629 | + | <source>This action did not complete correctly. Try again, and if the issue persists, consider sending a bug report at {}, or by email to {} with the following information, and any relevant information (what you were trying to do, other external factors, etc.) We received the following error message: {}. | |
618 | 630 | ||
619 | 631 | Traceback: | |
620 | 632 |
offlate/ui/about.py
21 | 21 | from PyQt5.QtGui import * | |
22 | 22 | from PyQt5.QtCore import * | |
23 | 23 | ||
24 | + | from ..data.common import REPO | |
25 | + | ||
24 | 26 | class AboutWindow(QDialog): | |
25 | 27 | def __init__(self, parent = None): | |
26 | 28 | super().__init__(parent) | |
… | |||
67 | 69 | issue_button.clicked.connect(self.issue) | |
68 | 70 | ||
69 | 71 | def issue(self): | |
70 | - | webbrowser.open('https://framagit.org/tyreunom/offlate/issues') | |
72 | + | webbrowser.open(REPO) |
offlate/ui/main.py
21 | 21 | from .manager import ProjectManagerWindow | |
22 | 22 | from .config.welcome import WelcomeWindow | |
23 | 23 | ||
24 | + | from ..data.common import REPO, EMAIL | |
25 | + | ||
24 | 26 | import sys | |
25 | 27 | import os | |
26 | 28 | ||
… | |||
42 | 44 | return | |
43 | 45 | ||
44 | 46 | w.projectManagerWidget.manager.setNotNew() | |
45 | - | w.show() | |
46 | - | ||
47 | - | sys.exit(app.exec_()) | |
47 | + | try: | |
48 | + | w.show() | |
49 | + | exit = app.exec_() | |
50 | + | except: | |
51 | + | info = sys.exc_info() | |
52 | + | traceback = '' | |
53 | + | trace = info[2] | |
54 | + | while trace is not None: | |
55 | + | traceback = traceback + str(trace.tb_frame) + "\n" | |
56 | + | trace = trace.tb_next | |
57 | + | dialog = QMessageBox() | |
58 | + | dialog.setWindowTitle("Fatal error") | |
59 | + | dialog.setText( | |
60 | + | dialog.tr("The app just crashed, please report the\ | |
61 | + | following error, with any relevant information (what you did\ | |
62 | + | when the app crashed, any external factor that might be relevant,\ | |
63 | + | etc.). You can send your report on {}, or by email to {}.\n\n{}\n\ | |
64 | + | Traceback:\n{}").format(REPO, EMAIL, info[1], traceback)) | |
65 | + | dialog.setStandardButtons(QMessageBox.Close) | |
66 | + | dialog.exec_() | |
67 | + | exit = 1 | |
68 | + | sys.exit(exit) |
offlate/ui/parallel.py
21 | 21 | from ..systems.exception import ProjectNotFoundSystemException | |
22 | 22 | from ..systems.callback import SystemCallback | |
23 | 23 | ||
24 | + | from ..data.common import REPO, EMAIL | |
25 | + | ||
24 | 26 | import sys | |
25 | 27 | ||
26 | 28 | class RunnableCallback(SystemCallback, QRunnable): | |
… | |||
44 | 46 | trace = trace.tb_next | |
45 | 47 | ||
46 | 48 | self.error = self.parent.tr('This action did not complete correctly. \ | |
47 | - | We received the following error message: {}.\n\nTraceback:\n\n{}\nTry \ | |
48 | - | again?'.format(error, traceback)) | |
49 | + | Try again, and if the issue persists, consider sending a bug report at {}, or \ | |
50 | + | by email to {} with the following information, and any relevant information \ | |
51 | + | (what you were trying to do, other external factors, etc.) We received the \ | |
52 | + | following error message: {}.\n\nTraceback:\n\n{}\nTry again?'.format(REPO, | |
53 | + | EMAIL, error, traceback)) | |
49 | 54 | self.signals.error.emit(self.name, self.error) | |
50 | 55 | ||
51 | 56 | def project_exists(self): |