Skip to content

Allow default and custom messages in derived classes from PyomoException#3596

Merged
jsiirola merged 15 commits intoPyomo:mainfrom
michaelbynum:string_issue
Jun 23, 2025
Merged

Allow default and custom messages in derived classes from PyomoException#3596
jsiirola merged 15 commits intoPyomo:mainfrom
michaelbynum:string_issue

Conversation

@michaelbynum
Copy link
Copy Markdown
Contributor

Summary/Motivation:

The new direct interface to Gurobi attempts to pass a custom message to IncompatibleModelError here:

raise IncompatibleModelError(
. However, that exception does not currently except custom messages. This PR enables custom messages.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt mrmundt self-requested a review May 29, 2025 20:29
@blnicho blnicho requested a review from jsiirola June 3, 2025 19:54
@mrmundt
Copy link
Copy Markdown
Contributor

mrmundt commented Jun 17, 2025

Per discussion today, we are just going to put this new functionality directly into PyomoException rather than making a new class for it. I'll work on that.

@mrmundt mrmundt changed the title Allow custom messages in IncompatibleModelError Allow default and custom messages in derived classes from PyomoException Jun 18, 2025
@jsiirola jsiirola merged commit e4c0ec0 into Pyomo:main Jun 23, 2025
52 of 65 checks passed
@blnicho blnicho moved this from Todo to Done in August 2025 Release Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants