Skip to content

add general exception handling guidance to CONTRIBUTING.md#3394

Merged
quaquel merged 3 commits intomesa:mainfrom
falloficarus22:exception-handling-guidelines
Feb 28, 2026
Merged

add general exception handling guidance to CONTRIBUTING.md#3394
quaquel merged 3 commits intomesa:mainfrom
falloficarus22:exception-handling-guidelines

Conversation

@falloficarus22
Copy link
Copy Markdown
Contributor

This PR adds a short “Exception handling guidance” section to CONTRIBUTING.md to make exception usage more consistent across Mesa.

What this PR changes

  • Adds repo-wide guidance to prefer clear, predictable exception behavior.
  • Recommends specific built-in exceptions for standard validation/input failures.
  • Clarifies when Mesa-specific exceptions should be used (domain context or API clarity).
  • Encourages consistent use of the existing MesaException hierarchy.
  • Recommends raise ... from ... when wrapping internal exceptions.
  • Adds guidance to keep exception messages actionable and to update tests when exception behavior changes.

Why
Recent exception-related discussions highlighted (#3380 (comment)) the need for a concise contributor guideline so future changes follow a shared approach and stay consistent.

@quaquel quaquel added the docs Release notes label label Feb 28, 2026
@quaquel quaquel merged commit afe47da into mesa:main Feb 28, 2026
3 of 4 checks passed
@falloficarus22
Copy link
Copy Markdown
Contributor Author

@quaquel I think we have a duplication in the CONTRIBUTING.md

@quaquel
Copy link
Copy Markdown
Member

quaquel commented Feb 28, 2026

you are right, the first entry on exceptions should be removed. No idea how that happend. A Pr is welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants