Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log traceback in case of exceptions during optimizations #1156

Merged
merged 8 commits into from
Oct 31, 2023
7 changes: 6 additions & 1 deletion pypesto/optimize/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def wrapped_minimize(
)
except Exception as err:
if optimize_options.allow_failed_starts:
logger.error(f'start {id} failed: {err}')
import sys
import traceback

trace = "\n".join(traceback.format_exception(*sys.exc_info()))

logger.error(f'start {id} failed:\n{trace}')
result = OptimizerResult(
x0=x0, exitflag=-1, message=str(err), id=id
)
Expand Down