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

Nicers error message while running bake command with an empty Bakefile #32

Open
rednafi opened this issue Nov 17, 2019 · 0 comments
Open
Labels
good first issue Good for newcomers

Comments

@rednafi
Copy link
Collaborator

rednafi commented Nov 17, 2019

Currently, if I run bake command when the Bakefile is empty, the error message seems very scary:

Traceback (most recent call last):
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/bin/bake", line 8, in <module>
    sys.exit(entrypoint())
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/cli.py", line 297, in entrypoint
    for _task in bf.tasks:
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 217, in tasks
    return self.tasks
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 217, in tasks
    return self.tasks
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 217, in tasks
    return self.tasks
  [Previous line repeated 974 more times]
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 212, in tasks
    for i, chunk in enumerate(self.chunks):
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 105, in chunks
    self._chunks = [c for c in self._iter_chunks()]
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 105, in <listcomp>
    self._chunks = [c for c in self._iter_chunks()]
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 65, in _iter_chunks
    all_chunks = [tl for tl in self._iter_chunk_task_lines()]
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 65, in <listcomp>
    all_chunks = [tl for tl in self._iter_chunk_task_lines()]
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 90, in _iter_chunk_task_lines
    for i, line in enumerate(self.source_lines):
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 166, in source_lines
    return self.source.split("\n")
  File "/home/redowan/.local/share/virtualenvs/flask-template-wBuRwttx/lib/python3.7/site-packages/bake/bakefile.py", line 162, in source
    return f.read()
RecursionError: maximum recursion depth exceeded while calling a Python object

Can we make this something nicer?

@rednafi rednafi pinned this issue Nov 17, 2019
@rednafi rednafi added the good first issue Good for newcomers label Nov 17, 2019
@rednafi rednafi changed the title Nicers error message while running bake command with an empty Bakefile Nicers error message while running bake command with an empty Bakefile Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant