RFR: 1625: Validate input from /summary command

Erik Joelsson erikj at openjdk.org
Fri Oct 21 22:14:50 UTC 2022

On Fri, 21 Oct 2022 21:49:30 GMT, Zhao Song <zsong at openjdk.org> wrote:

> Ok, my bad. I was thinking it is a little difficult to catch the specific exception. I look through the code again and find if the commit message is bad, `PullRequestCheckIssueVisitor` will throw `IllegalStateException`, so we just need to catch `IllegalStateException`, right?

No, that's a too generic exception, and also IMO not used correctly here. If we are to treat this specific case in a unique way we need to introduce a new exception type just for this. I would suggest `BadCommitMessageException` (extends `RuntimeException`). This becomes a contract between `PullRequestCheckIssueVisitor` and `CheckRun`, which can then catch just this exception and make it an integration blocker.


PR: https://git.openjdk.org/skara/pull/1401

More information about the skara-dev mailing list