Removing cast to str in exceptions