Skip to content

Commit

Permalink
Store _stderrdata when ert_script fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngve S. Kristiansen committed Oct 26, 2023
1 parent 4df77b4 commit 7cebd3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ert/config/ert_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def initializeAndRun(
self.output_stack_trace(error=error_msg)
return None
except Exception as e:
self.output_stack_trace(str(e))
full_trace = "".join(traceback.format_exception(*sys.exc_info()))
self.output_stack_trace(f"{str(e)}\n{full_trace}")
return None
finally:
self.cleanup()
Expand All @@ -122,6 +123,8 @@ def output_stack_trace(self, error: str = "") -> None:
f"The script '{self.__class__.__name__}' caused an "
f"error while running:\n{str(stack_trace).strip()}\n"
)

self._stderrdata = error
self.__failed = True

@staticmethod
Expand Down

0 comments on commit 7cebd3f

Please sign in to comment.