CellML Discussion List

Text archives Help


[[cellml-discussion] ] 'loadFromURL' errors


Chronological Thread 
  • From: Lucian Smith <lucianoelsmitho AT gmail.com>
  • To: cellml-discussion AT lists.cellml.org
  • Subject: [[cellml-discussion] ] 'loadFromURL' errors
  • Date: Mon, 13 Jan 2014 16:25:13 -0800

So, in the past, this code once worked:

try
{
model =
already_AddRefd<iface::cellml_api::Model>(ml->loadFromURL(wideFilename.c_str()));
}
catch (...)
{
string file(filename);
RETURN_INTO_WSTRING(error, ml->lastErrorMessage());
string emsg(makeUTF8(error));
[...]
}

In other words, it would try to load a model from a URL, and if that
didn't work, would create an error message I could get from
'lastErrorMessage'.

However, I have now repeatedly run into problems with this code not
actually returning an error message, which ends up creating 'error'
with a bad pointer, which then crashes my code when it tries to turn
it back into a real string instead of the wide string.

Is there any way I can guard against this situation, and/or find a way
to fix the problem?

-Lucian



Archive powered by MHonArc 2.6.18.

Top of page