Added test for exceptions in tryCatch

- added test for exceptions in tryCatch
- added helper with sanitize() function