flyingcircusio / batou

batou is a universal, fractal deployment utility using Python.
https://batou.readthedocs.org
Other
47 stars 11 forks source link

Add traceback to component loading error #426

Closed elikoga closed 9 months ago

elikoga commented 9 months ago

Closes #261

Looks like this:

% ./batou deploy tutorial
batou/2.5.dev0 (cpython 3.7.16-final0, Darwin 23.1.0 arm64)
=================================================== Preparing ====================================================
main: Loading environment `tutorial`...
main: Verifying repository ...
main: Loading secrets ...

ERROR: Failed loading component file
           File: /Users/elikoga/batou/examples/tutorial-helloworld/components/hello/component.py
      Exception: __init__() takes from 1 to 5 positional arguments but 6 were given
Traceback (simplified, most recent call last):
  File "/Users/elikoga/batou/examples/tutorial-helloworld/components/hello/component.py", line 5, in <module>
    class Hello(Component):
  File "/Users/elikoga/batou/examples/tutorial-helloworld/components/hello/component.py", line 6, in Hello
    asd = Attribute(1, 2, 3, 4, 5)

ERROR: Missing component
      Component: hello
======================================== DEPLOYMENT FAILED (during load) =========================================