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

Runtime: report good errors for top level console.log and the like #772

Closed
josephjclark opened this issue Sep 17, 2024 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@josephjclark
Copy link
Collaborator

If you do this at the top of your job code:

console.log('hello')

You'll probably get a vague error like fn is not a function, and you'll be upset and you won't know what's happening.

What IS happening is that the runtime is treating the console.log call like an operation, so it's trying to call it, take the returned function, and add it to the execute pipeline.

Aside from generally printing better error messages (including source line) what can we do here?

  • Well, the runtime should be able to work out that something which is not an operation was passed into its pipeline, and it should at least be able to throw a decent error message (operation 5 was not an operation - did you call an adaptor function?)
  • The compiler could possibly detect console.log explicitly and raise a warning. But not only is that sketchy, Lightning doesn't include compiler logs yet (right?(
@github-project-automation github-project-automation bot moved this to New Issues in v2 Sep 17, 2024
@josephjclark
Copy link
Collaborator Author

Duplicate of #811

@josephjclark josephjclark marked this as a duplicate of #811 Nov 22, 2024
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Nov 22, 2024
@josephjclark josephjclark added the duplicate This issue or pull request already exists label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
Archived in project
Development

No branches or pull requests

1 participant