octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49155] No error identifier when loading a non


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #49155] No error identifier when loading a nonexistant package
Date: Thu, 22 Sep 2016 22:17:28 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #4, bug #49155 (project octave):

Is a specific error id for missing package really that useful? If you have a
program that needs a specific package, then it doesn't matter for the writer
of the program if the package fails to load because is not installed or if
there is some other reason that makes it fail to load. And when it matters,
it's easy to check first if the package is installed.

I'd imagine the following snippet to be more useful in a real case:


try
  pkg load foobar;
catch
  error ("failed to load package foobar: %s", lasterr ());
end_try_catch


Which in my cases throws back "error: failed to load package foobar: package
foobar is not installed" (in practice, I never check this, the uncatched error
message should be enough).

Also, note that just because a package is loaded, doesn't mean a specific
function will be available. Some packages will disable some functions.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49155>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]