1008
1008
if pkgname and pkgname in self.pending_transactions:
1009
1009
del self.pending_transactions[pkgname]
1011
# calculate a dupes_signature here to have different buckets
1012
# on errors.ubuntu.com for the different crash types
1013
dupes_signature = "software-center:trans-failed:%s" % trans.error_code
1011
1015
self.emit("transaction-stopped", result)
1012
1016
if isinstance(error, dbus.DBusException):
1013
1017
# ignore errors that the user knows about already (like
1025
1029
"the authentication service is not available. "
1027
1031
# send to apport for reporting
1028
self._call_apport_recoverable_error(text, error)
1032
self._call_apport_recoverable_error(
1033
text, error, dupes_signature)
1029
1034
# ... and display as a dialog
1030
1035
self.ui.error(None, summary, text)
1033
1038
# lintian errors are ignored and not send to apport_recoverable_error
1034
if trans.error_code == enums.ERROR_INVALID_PACKAGE_FILE:
1039
# and dpkg errors as well as they will already be recorded seperately
1041
if trans.error_code in (enums.ERROR_INVALID_PACKAGE_FILE,
1042
enums.ERROR_PACKAGE_MANAGER_FAILED):
1037
1045
# show a apport recoverable error dialog to the user as we want
1038
1046
# to know about these issues
1039
1047
self._call_apport_recoverable_error(
1040
_("There was an error submitting the transaction"), error)
1048
_("There was an error submitting the transaction"),
1042
def _call_apport_recoverable_error(self, text, error):
1052
def _call_apport_recoverable_error(self, text, error, dupes_signature):
1043
1053
"""Call apports recoverable_problem dialog """
1045
1055
# ensure we have a proper expection string in the report
1049
1059
# mvo: I don't think we need to send "Package\0software-center",
1050
1060
# apport should figure this out itself
1051
data = "DialogBody\0%(text)s\0Traceback\0%(error)s" % {
1061
data = ("DialogBody\0%(text)s\0"
1062
"Traceback\0%(error)s\0"
1063
"DuplicateSignature\0%(dupes_signature)s" % {
1053
1065
'error': error,
1066
'dupes_signature': dupes_signature,
1055
1068
# This will be quick as it just writes the report file. Then
1056
1069
# the report gets picked up asynchronously by a inotify watch
1057
1070
# and displayed to the user in a seperate process.