12.5 Logic–error exceptional–condition objects

Logic–error exceptional–conditions are used to signal a programming error: something that should not happen in a perfect script. For example: parameters of the wrong type handed to a function call; out–of–range array indexes. We can use them as follows:

mbfl_default_object_declare(CND)

mbfl_logic_error_condition_make _(CND) 'someone' 'internal error'
mbfl_exception_raise _(CND)

Usually when an exceptional–condition of this class is raised, the correct handling is to: attempt a clean release of all the resources; inform the user; terminate the program with an appropriate exit status.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.