catch an exception to display a better error message