Skip to content

Added fix for Python preview expression error #4991

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

Conversation

elebitzero
Copy link
Member

@elebitzero elebitzero commented Jun 27, 2022

Fixes #3012

I looked into this and found errors are being returned, but the Jython parser is return full exception traces instead of just reporting the error.

I have changed it to return e.getMessage() instead of e.toString()

Msg Before:

Traceback (most recent call last):
  File "<string>", line 2, in __temp_594255022__
AttributeError: 'com.google.refine.jython.JythonHasFieldsWrapper' object has no attribute 'a'

Msg After:
AttributeError: 'com.google.refine.jython.JythonHasFieldsWrapper' object has no attribute 'a'

Before:
image

After:
image

@github-actions github-actions bot added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. error handling Improving the ways errors are reported to users jython Uses of Python as expression language via Jython labels Jun 27, 2022
@elebitzero elebitzero changed the title Added fix for Python preview expression error. Added fix for Python preview expression error Jun 27, 2022
@wetneb wetneb merged commit 593e7e4 into OpenRefine:master Jun 27, 2022
@elebitzero elebitzero deleted the issue-3012-python-preview-expression-error-handling branch April 11, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Improving the ways errors are reported to users jython Uses of Python as expression language via Jython Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python expression preview doesn't always report errors
2 participants