catching exceptions while preparing url to redirect to, close #11910