Skip to content

Fix Knapsack and NQueens verifiers to throw CertificateParseException#312

Closed
Trosper3 wants to merge 1 commit into
CSharpAPIfrom
bugfix/knapsack-nqueens-verifier-parse-exceptions
Closed

Fix Knapsack and NQueens verifiers to throw CertificateParseException#312
Trosper3 wants to merge 1 commit into
CSharpAPIfrom
bugfix/knapsack-nqueens-verifier-parse-exceptions

Conversation

@Trosper3

Copy link
Copy Markdown
Contributor

Both verifiers had bare catch { return false; } blocks that silently swallowed parse errors, giving callers no indication of why a certificate was rejected. They now re-throw CertificateParseException (passthrough if already that type, otherwise wrapping the underlying exception with the certificate string and a detail message), matching the codebase-wide convention established in other verifiers.

KnapsackVerifier.parseCertificate also updated to throw CertificateParseException with a descriptive message instead of a bare Exception when an item is not in the problem's item set.

Both verifiers had bare `catch { return false; }` blocks that silently
swallowed parse errors, giving callers no indication of why a
certificate was rejected. They now re-throw CertificateParseException
(passthrough if already that type, otherwise wrapping the underlying
exception with the certificate string and a detail message), matching
the codebase-wide convention established in other verifiers.

KnapsackVerifier.parseCertificate also updated to throw
CertificateParseException with a descriptive message instead of a bare
Exception when an item is not in the problem's item set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trosper3 Trosper3 closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant