handle user error in blob to file.

This commit is contained in:
Vítor Santos Costa 2015-11-05 15:14:11 +00:00
parent 4c0615bb54
commit b9369e1e7d

View File

@ -43,6 +43,9 @@ char * Yap_blob_to_string(AtomEntry *ref, const char *s0, size_t sz)
} }
Atom at = AbsAtom(ref); Atom at = AbsAtom(ref);
rc = type->write(f, at, 0); rc = type->write(f, at, 0);
if (rc < 0) {
Yap_Error( EVALUATION_ERROR_UNDEFINED, MkAtomTerm(at), "failure in user-defined blob to string code" );
}
fclose(f); // return the final result. fclose(f); // return the final result.
return s; return s;
} else { } else {