diff --git a/PyMca5/PyMcaGui/physics/xrf/QtMcaAdvancedFitReport.py b/PyMca5/PyMcaGui/physics/xrf/QtMcaAdvancedFitReport.py
index afe0c54b6..3898d1c3f 100644
--- a/PyMca5/PyMcaGui/physics/xrf/QtMcaAdvancedFitReport.py
+++ b/PyMca5/PyMcaGui/physics/xrf/QtMcaAdvancedFitReport.py
@@ -739,6 +739,9 @@ def getResult(self):
for peak0 in iterator:
name = peak0+"esc"
peak = peak0+"esc"
+ if name not in result[group]:
+ # i.e. peak0 = "Al K" and Si detector
+ continue
if result[group][name]['ratio'] > 0.0:
text += '
| '
energy = ("%.3f" % (result[group][peak]['energy']))
diff --git a/PyMca5/PyMcaGui/pymca/PyMcaBatch.py b/PyMca5/PyMcaGui/pymca/PyMcaBatch.py
index 96a032c23..eea0aea1a 100644
--- a/PyMca5/PyMcaGui/pymca/PyMcaBatch.py
+++ b/PyMca5/PyMcaGui/pymca/PyMcaBatch.py
@@ -35,6 +35,7 @@
import signal
import atexit
import logging
+import traceback
from glob import glob
from contextlib import contextmanager
try:
@@ -1822,6 +1823,10 @@ def onMca(self, ddict):
except Exception:
_logger.warning("ERROR on REPORT %s", sys.exc_info())
_logger.warning("%s", sys.exc_info()[1])
+ try:
+ _logger.warning("%s", ''.join(traceback.format_tb(sys.exc_info()[2])))
+ except Exception:
+ pass
_logger.warning("filename = %s key =%s " , filename, key)
_logger.warning("If your batch is stopped, please report this")
_logger.warning("error sending the above mentioned file and the")