Yes, you can. Have you tried it? In the code, it should be just like catching any other exception.
I strongly recommend that in addition to presenting the user with a nice friendly looking message, you make sure the complete details of the exception (including stack trace) are logged in a file somewhere. Because there's usually a lot of useful information in those things, and people who try to protect end users from seeing them very often manage to lose that useful information in the process. Don't be one of those people.