Menu

#96 RFE: Improve error handling

v1.0 (example)
closed-fixed
None
5
2013-12-20
2013-02-13
Yarda
No

The current error handling is poor. E.g. if the device open fail, there is no way how the library could signal this to the caller and there is also no handler in the espeak binary which can results in core.

This problem was originally reported in RHBZ:
https://bugzilla.redhat.com/show_bug.cgi?id=904302

I tried to fix this the least intrusive way and not break the current libespeak API/ABI. It could be probably fixed much better way or possibly the interface redesigned, but the idea should be clear from the patch.

Discussion

  • Jonathan Duddington

    Fix is now included in development version 1.46.35 at:
    http;//espeak.sf.net/test/latest.html

    I will make a new official release (1.47) soon.

     
  • Jonathan Duddington

    • assigned_to: nobody --> jonsd
    • status: open --> open-fixed
     
  • Kevin Kofler

    Kevin Kofler - 2013-02-27

    I see in 2 places:
    -void wave_init(int srate) {}
    +int wave_init(int srate) {}
    There's a return statement missing there!

     
  • Yarda

    Yarda - 2013-02-28

    Proposed fix.

     
  • Yarda

    Yarda - 2013-02-28

    Kevin thanks for spotting this, I overlooked them as declarations :) This shouldn't be problem in Fedora as this code path shouldn't be executed there.

    I uploaded new version of the patch. I also negated the return code of the wave_init to be more consistent with the other code, now 0 means success.

    The newly added return statements that were previously missing now returns 0 (success), maybe the failure return code would be better, but I tried to keep the logic same as with wave_close.

     
  • Jonathan Duddington

    • status: open-fixed --> closed-fixed
    • Group: --> v1.0 (example)
     

Log in to post a comment.