in reply to different between die and exit

If you want to trap whatever error happened use die function, to capture the error message. The exit does not.