Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed changes to give user friendlier messages on missing cloneType #1

Merged
merged 3 commits into from
Oct 17, 2018

Conversation

chick
Copy link
Collaborator

@chick chick commented Oct 17, 2018

This fix is a stab at providing some useful information

  • Add new GetReferenceException to builder
  • catch .get on None in emitType on aggregate
  • Throw partially filled in GetReferenceException
  • provide as much information as possible, which seems to be the field names of the bundle

I would like to have provided name or line numbers or sourceInfo but neither seem to be available at the necessary points in the stack when the error occurs.

- Add new GetReferenceException to builder
- catch .get on None in emitType on aggregate
- Throw partially filled in GetReferenceException
-
@chick chick requested a review from grebe October 17, 2018 00:09
Copy link
Owner

@grebe grebe left a comment

Choose a reason for hiding this comment

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

This looks really nice and clean to me!

catch {
case getRef: GetReferenceException =>
throw new GetReferenceException(s"Cannot emit ports for ${d.className}" +
s" with fields ${d.elements.keys.mkString(",")}, perhaps cloneType is not defined")
Copy link
Owner

Choose a reason for hiding this comment

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

I think the error message should say "perhaps you forgot a cloneType"- I think this is about calling cloneType on bundle fields, not defining cloneType for the bundle.

@grebe grebe merged commit bb8b671 into badErrorMessageCloneType Oct 17, 2018
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