isl_pw_*_gist: improve error handling