refactoring: ApplicationException and UserException accept a parameter with previous exception