"solara run" exits with code 0 when exited with an exception
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 202
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 3
Description
This is a minimum example to reproduce the problem.
# pages/index.py
import solara
raise Exception("Error")
@solara.component
def Page():
solara.Text("Hello World!")
The reason why this is a problem is that it's common to declare global constants with os.environ["KEY"] at the top of Python files.
We have a script that runs solara run in a subprocess and checks its exit code. But it doesn't work correctly because it always exits with code 0.
Expected Behavior
solara process exits with a non-zero exit code
Current Behavior
solara process exits with exit code 0
Steps to Reproduce the Problem
- Create
pages/index.pywith the example above - Run solara
solara run pages
- Check exit code
echo $?
Specifications
- Solara Version: 1.44.0
- Platform: macOS
- Affected Python Versions: 3.12.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the supplied pages/index.py example and run solara run pages, then inspect the entry point handling that command's subprocess or server exit status. Done means an exception during module loading causes the Solara process to return a non-zero exit code, verified with echo $?.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100