xcosPalAddBlock() should be more robust and explicit before/when failing
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
1) Since xcosPalAddBlock() is a public function, it should check for required sublibraries and load (and return with resume()) them when required.
For instance, %Block_load() is used inside, but this function belongs to scicos_scicoslib, that is not loaded by default. This yields an error, telling that %Block_load() should be defined.
When a function is public and uses some libraries considered as internal, then it must automatically check for these libraries and load them, instead of failing.
2) When for some reason a .sod file is missing in the images/h5 directory of a module, the error message is obscur (see below).
It does not tell that the issue is about a missing file, and it does not tell which file. It should tell both, instead.
!--error 10000
xcosPalAddBlock: Wrong type for input argument "block": function as string or Block type or full path string expected.
at line 89 of function xcosPalAddBlock called by :
at line 10 of function tbx_build_pal called by :
at line 16 of function runMe called by :
runMe();
at line 104 of exec file called by :
exec(etc_tlbx+"blocks.sce", -1);
at line 72 of exec file called by :
exec(get_absolute_file_path("loader.sce")+"etc/"+"coselica.start");
at line 10 of exec file called by :
exec("SCI\contrib\coselica_0.6.4\\loader.sce");
in execstr instruction called by :
; end;gcbo = getcallbackobject(85);execstr(toolboxes(2));if exists("%oldgcbo") then gcbo = %oldgcbo; else clear g
while executing a callback