Skip to content

Conversation

johnedquinn
Copy link
Member

Description

  • Audits eval package. Adds Javadocs and exceptions.
  • Creates PRuntimeException in favor of PErrorListenerException and PErrorException. Adds some documentation there.

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@johnedquinn johnedquinn requested a review from alancai98 January 17, 2025 17:00
@johnedquinn johnedquinn marked this pull request as ready for review January 17, 2025 17:00
Comment on lines +167 to +169
} catch (t: Throwable) {
throw PErrors.internalErrorException(t)
}
Copy link
Member

Choose a reason for hiding this comment

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

I haven't checked this locally but shouldn't the non-PRuntimeExceptions be caught? I guess not a big deal to add an additional catch just in case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wdym? We are catching Throwable here

Copy link
Member

Choose a reason for hiding this comment

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

To rephrase, I was initially thinking that all the Throwable exceptions were already wrapped in a PRuntimeException, but seems like we need this additional catch in case there's some exception that we haven't already wrapped in a PRuntimeException. For example (this specific case has been fixed by #1720), 1.0 / 0.0 would give a "java.lang.ArithmeticException: / by zero" which would be wrapped in a PRuntimeException with code PError.INTERNAL_ERROR rather than a PRuntimeException with code PError.DIVISION_BY_ZERO. So the following two cases would give different error codes:

1 / 0 -- division by zero error
1.0 / 0.0 -- internal error

I think this catch(throwable) is fine for now, but we should make sure exceptions we throw try to use the existing PRuntimeException codes.

@johnedquinn johnedquinn merged commit b11f324 into partiql:main Jan 21, 2025
7 checks passed
@johnedquinn johnedquinn deleted the main-audit-eval branch January 21, 2025 19:07
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