Flask cli user show should return message when user doesn't exist
flask cli user show <non-existing-user>
returns a stack trace instead of a readable message:
❯ stack user show admin
None
Traceback (most recent call last):
File "/usr/local/bin/flask", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 995, in main
cli.main(args=sys.argv[1:])
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 601, in main
return super().main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1053, in main
^[[A rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 445, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/src/app/app.py", line 217, in show_user
print(f"UUID: {user.uuid}")
AttributeError: 'NoneType' object has no attribute 'uuid'
command terminated with exit code 1