Skip to content

Replace ParseError with MultiException in FuzzData#1634

Merged
olabusayoT merged 1 commit intoapache:mainfrom
olabusayoT:daf-3075-fix-catch
Mar 4, 2026
Merged

Replace ParseError with MultiException in FuzzData#1634
olabusayoT merged 1 commit intoapache:mainfrom
olabusayoT:daf-3075-fix-catch

Conversation

@olabusayoT
Copy link
Contributor

  • Updated logic to handle multiple exceptions using MultiException, replacing the older ParseError usage across methods in FuzzData.scala.
  • Adjusted related method and variable names for consistency.

DAFFODIL-3075

@olabusayoT olabusayoT force-pushed the daf-3075-fix-catch branch 2 times, most recently from cbe1212 to 49b510f Compare February 25, 2026 19:23
Copy link
Member

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

} catch {
case p: ParseError => {
handleParseError(p, testData, i)
case p: MultiException[Throwable] @unchecked => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be marked as unchecked?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the compiler complains otherwise


var shouldFail = false

override def handleParseError(p: ParseError, data: Array[Byte], nth: Int): Unit = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth changing the argument names from p to ex or something to better match what the argument represents?

Copy link
Contributor

@jadams-tresys jadams-tresys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- Consolidated exception handling under `handleKnownException` to manage both `MultiException` and `ParseError`. This is because MultiException.toss can throw either a ParseError or a MultiException
- Adjusted related method and variable names for consistency.

DAFFODIL-3075
@olabusayoT olabusayoT force-pushed the daf-3075-fix-catch branch from 6ecff5b to 34982b0 Compare March 4, 2026 16:09
@olabusayoT olabusayoT merged commit b2431b6 into apache:main Mar 4, 2026
18 of 20 checks passed
@olabusayoT olabusayoT deleted the daf-3075-fix-catch branch March 4, 2026 18:52
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.

3 participants