move exception typecheck for calling stringifyException into the method itself