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

undefined property bad error #7608

Closed
scottdraves opened this issue Jun 29, 2018 · 0 comments
Closed

undefined property bad error #7608

scottdraves opened this issue Jun 29, 2018 · 0 comments
Assignees

Comments

@scottdraves
Copy link
Contributor

in groovy if i try to get the value of an undefined value on the beakerx object i get a bad error. to reproduce, create a new groovy notebook and evaluate:

beakerx.nothing

and get this error:

java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'undefined': was expecting ('true', 'false' or 'null')
 at [Source: undefined; line: 1, column: 19]
	at com.twosigma.beakerx.DefaultBeakerXJsonSerializer.fromJson(DefaultBeakerXJsonSerializer.java:59)

instead it should work like python does, which gives this error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-af370edb827d> in <module>()
      1 from beakerx import beakerx
----> 2 beakerx.nothing

~/src/beakerx/beakerx/beakerx/runtime.py in __getattr__(self, name)
    582 
    583     def __getattr__(self, name):
--> 584         return self.get(name)
    585 
    586     def __contains__(self, name):

~/src/beakerx/beakerx/beakerx/runtime.py in get(self, var)
    451         result = autotranslation_get(var)
    452         if result == 'undefined':
--> 453             raise NameError('name \'' + var + '\' is not defined in notebook namespace')
    454         return transformBack(json.loads(result))
    455 

NameError: name 'nothing' is not defined in notebook namespace

also, change the python error. we don't call it the notebook namespace anymore.
just say "name 'nothing' is not defined on the beakerx object"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants