Skip to content

Replace ParseError with MultiException in FuzzData#1634

Open
olabusayoT wants to merge 2 commits intoapache:mainfrom
olabusayoT:daf-3075-fix-catch
Open

Replace ParseError with MultiException in FuzzData#1634
olabusayoT wants to merge 2 commits 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

- 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
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?

…ception` and `ParseError`

- Consolidated exception handling under `handleKnownException` to manage both `MultiException` and `ParseError`. This is because MultiException.toss can throw either a ParseError or a MultiException

DAFFODIL-3075
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.

2 participants