Handle exceptions when starting server