error handling around dxf_cross; function signatures

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

error handling around dxf_cross; function signatures

chrysn
hi developers,

openscad crashes when dxf_cross gets called with an invalid file name or
no file name at all.

i suppose there should be some errorhandling around src/dxfdim.cc:147,
or something else should take care of such things:

> Qt has caught an exception thrown from an event handler. Throwing
> exceptions from an event handler is not supported in Qt. You must
> reimplement QApplication::notify() and catch all exceptions there.
>
> terminate called after throwing an instance of
> 'boost::filesystem3::filesystem_error' what():
> boost::filesystem::file_size: No such file or directory

----------

by the way, there was some confusion about the arguments to dxf_cross in
the wiki[1] (and probably will still be until someone signs off the latest
changes).

is there any way we might get openscad function signatures out of the
source code? it seems there isn't as of now; the only ideas i have about
it are

* dangerous regular expressions to pseudoparse the source code
  (looking for Builtins::init for the function names and argnames loops
  / if statements for the arguments)

  (yuck) and

* adding doxygen-style comments or similar to every declaration of an
  openscad function

  (lots of work too).

the current situation (documentation very far from the code) seems to
make it very easy for problems to come up.

what are your ideas on this?


best regards
chrysn

[1] http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Getting_input

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom

signature.asc (836 bytes) Download Attachment