is it possible to handle the `KeyError` on an inva...
# python
s
is it possible to handle the
KeyError
on an invalid
require_output
? if I do this:
Copy code
try:
    foo = stack_output.require_output("doesnt_exist")
except KeyError:
    # whatever
the key error seems to be unhandled:
Copy code
value = Output.all(Output.from_input(name), self.outputs).apply(lambda l: l[1][l[0]]) # type: ignore
    KeyError: 'doesnt_exist'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
r
Do you mean to use get_output instead since it's not guaranteed?
s
I actually just found that one, thanks 🙂
it looks to work better for this use case yeah