Helps testing error throwing of functions.