This should be `msg`, not `err`. The latter returns with a non-zero exit code, as well as printing a message.