touched up error message handling
This commit is contained in:
parent
b64fdb0019
commit
88861aa522
@ -542,8 +542,10 @@ static void* dl_open (moo_t* moo, const moo_ooch_t* name, int flags)
|
||||
if (!handle)
|
||||
{
|
||||
moo_bch_t* dash;
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open(ext) DL %js - %hs", name, sys_dl_error());
|
||||
MOO_DEBUG3 (moo, "Failed to open(ext) DL %hs[%js] - %hs\n", &bufptr[len], name, sys_dl_error());
|
||||
const moo_bch_t* dl_errstr;
|
||||
dl_errstr = sys_dl_error();
|
||||
MOO_DEBUG3 (moo, "Failed to open(ext) DL %hs[%js] - %hs\n", &bufptr[len], name, dl_errstr);
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open(ext) DL %js - %hs", name, dl_errstr);
|
||||
dash = moo_rfindbchar(bufptr, moo_countbcstr(bufptr), '-');
|
||||
if (dash)
|
||||
{
|
||||
@ -580,8 +582,10 @@ static void* dl_open (moo_t* moo, const moo_ooch_t* name, int flags)
|
||||
handle = sys_dl_open(bufptr);
|
||||
if (!handle)
|
||||
{
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open DL %js - %hs", name, sys_dl_error());
|
||||
MOO_DEBUG2 (moo, "Failed to open DL %hs - %hs\n", bufptr, sys_dl_error());
|
||||
const moo_bch_t* dl_errstr;
|
||||
dl_errstr = sys_dl_error();
|
||||
MOO_DEBUG2 (moo, "Failed to open DL %hs - %hs\n", bufptr, dl_errstr);
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open DL %js - %hs", name, dl_errstr);
|
||||
}
|
||||
else MOO_DEBUG2 (moo, "Opened DL %hs handle %p\n", bufptr, handle);
|
||||
}
|
||||
@ -590,8 +594,10 @@ static void* dl_open (moo_t* moo, const moo_ooch_t* name, int flags)
|
||||
handle = sys_dl_openext(bufptr);
|
||||
if (!handle)
|
||||
{
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open(ext) DL %js - %hs", name, sys_dl_error());
|
||||
MOO_DEBUG2 (moo, "Failed to open(ext) DL %hs - %hs\n", bufptr, sys_dl_error());
|
||||
const moo_bch_t* dl_errstr;
|
||||
dl_errstr = sys_dl_error();
|
||||
MOO_DEBUG2 (moo, "Failed to open(ext) DL %hs - %hs\n", bufptr, dl_errstr);
|
||||
moo_seterrbfmt (moo, MOO_ESYSERR, "unable to open(ext) DL %js - %hs", name, dl_errstr);
|
||||
}
|
||||
else MOO_DEBUG2 (moo, "Opened(ext) DL %hs handle %p\n", bufptr, handle);
|
||||
}
|
||||
@ -679,7 +685,10 @@ static void* dl_getsym (moo_t* moo, void* handle, const moo_ooch_t* name)
|
||||
sym = sys_dl_getsym(handle, symname);
|
||||
if (!sym)
|
||||
{
|
||||
moo_seterrbfmt (moo, MOO_ENOENT, "unable to get module symbol %hs", symname);
|
||||
const moo_bch_t* dl_errstr;
|
||||
dl_errstr = sys_dl_error();
|
||||
MOO_DEBUG3 (moo, "Failed to get module symbol %js from handle %p - %hs\n", name, handle, dl_errstr);
|
||||
moo_seterrbfmt (moo, MOO_ENOENT, "unable to get module symbol %hs - %hs", symname, dl_errstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -569,8 +569,7 @@ moo_mod_data_t* moo_openmod (moo_t* moo, const moo_ooch_t* name, moo_oow_t namel
|
||||
load = moo->vmprim.dl_getsym(moo, md.handle, buf);
|
||||
if (!load)
|
||||
{
|
||||
const moo_ooch_t* oldmsg = moo_backuperrmsg (moo);
|
||||
moo_seterrbfmt (moo, moo_geterrnum(moo), "unable to get module symbol [%js] in [%.*js] - %js", buf,namelen, name, oldmsg);
|
||||
moo_seterrbfmt (moo, moo_geterrnum(moo), "unable to get module symbol [%js] in [%.*js] - %js", buf,namelen, name);
|
||||
MOO_DEBUG3 (moo, "Cannot get a module symbol [%js] in [%.*js]\n", buf, namelen, name);
|
||||
moo->vmprim.dl_close (moo, md.handle);
|
||||
return MOO_NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user