When mongosh can't connect to the given mongodb deployment, it prints an error and then just hangs until you Ctrl-C.
It would probably be best to exit with exit code != 0.