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

'TypeError: exceptions must derive from BaseException' when missing argument label #131

Closed
huonw opened this issue Jan 1, 2021 · 2 comments

Comments

@huonw
Copy link

huonw commented Jan 1, 2021

The following code fails with an unhelpful exception:

persistent_notification.create("foo")
Exception in <jupyter_0> line 1:
    persistent_notification.create("foo")
                                   ^
TypeError: exceptions must derive from BaseException

The correct code is persistent_notification.create(message="foo") but the error message doesn't hint at this at all.

PyScript version: 1.0.0 (eb4dde9)

(Thanks for pyscript, it's a very nice way to write automations and data processing services.)

@craigbarratt
Copy link
Member

This was fixed in 1.1.0 with commit f1d2449.

The error is now reported as:

Exception in <jupyter_0> line 1:
    persistent_notification.create("foo")
                                   ^
TypeError: service persistent_notification.create takes only keyword arguments

@huonw
Copy link
Author

huonw commented Jan 1, 2021

Ah, great, apologies and thanks!

@huonw huonw closed this as completed Jan 1, 2021
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

No branches or pull requests

2 participants