You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have too many obtuse return codes for various functions. Add an enum thats something like OLEG_SUCCESS and OLEG_FAILURE. Have all ol_* and olt_* functions return them.
Then, when this is done, fix the stupid error handling in all of the ol_* wrapper functions. I'm talking about this:
intol_jar(ol_database*db, constchar*key, size_tklen,
constunsigned char*value, size_tvsize) {
/* ... Stuff omitted ... */ol_transaction*tx=olt_begin(db);
intjar_ret=10;
check(tx!=NULL, "Could not begin implicit transaction.");
jar_ret=olt_jar(tx, key, klen, value, vsize);
check(jar_ret==0, "Could not jar value. Aborting.");
check(olt_commit(tx) ==0, "Could not commit transaction.");
returnjar_ret;
error:
if (tx!=NULL&&jar_ret!=10)
olt_abort(tx);
returnjar_ret;
}
Something that'd be pretty cool here is to return SUCCESS/FAILURE, but in addition modify an internal variable to set what happened so we can still get access to some error granularity. This is an sqlite style thing which I really like. This would entail adding some kind of ol_error(const ol_database *db, char *out_ptr) function to return a set of standardized error codes.
The text was updated successfully, but these errors were encountered:
We have too many obtuse return codes for various functions. Add an enum thats something like
OLEG_SUCCESS
andOLEG_FAILURE
. Have allol_*
andolt_*
functions return them.Then, when this is done, fix the stupid error handling in all of the
ol_*
wrapper functions. I'm talking about this:Something that'd be pretty cool here is to return
SUCCESS
/FAILURE
, but in addition modify an internal variable to set what happened so we can still get access to some error granularity. This is ansqlite
style thing which I really like. This would entail adding some kind ofol_error(const ol_database *db, char *out_ptr)
function to return a set of standardized error codes.The text was updated successfully, but these errors were encountered: