Fix evaluation error when no evaluation code is provided #1472
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to resolve a bug where if there is no code to be evaluated in the playground stepper, an error will be thrown in the page (see attached image below:)
The bug can be replicated by simply executing empty code in the playground stepper, or when modules are imported but no code has been provided, e.g.
The first commit attempts to resolve the problem, but no useful information is provided back to the user (looks as if nothing has occurred) (maybe this could be detected and implemented via the frontend?), and thus the second commit will return an evaluation response with a message to signal that nothing has been evaluated (see images below):
New behaviour when nothing is evaluated (click to expand)
If the second commit/user interaction feedback is not required (e.g. implemented in frontend), feel free to let me know and I will remove the commit from this PR.
Testing
These changes have been tested locally, and no longer produces the error as shown above in the first image.