An error occurred while fetching folder content.
Jonathan Schöbel
authored
Error handling is done by passing an Error structure as inout parameter to functions that can fail on runtime predictable. This parameter is always the last one. Methods, where this is not the case, doesn't have an error parameter. When an Error is detected, also an ERROR is passed to the log. Because this isn't implemented yet, it is replaced by a nop. The macro EXIT becomes now useless. It was used earlier in case of an error, to terminate the program in the first place. This behaviour is not userfriendly, but it can't be decided on the library's side, whether there is an option to inform the user, something must be cleaned up or even that recovering is possible at all. Often these recognized errors are a non-working malloc or an over-/underflow. Error handling can be ignored by the caller by passing NULL to the Error parameter. Whether an error had occured, is also always possible to be determined, by examining the return value. If the error occours in a function returning a pointer, NULL will be returned. If it returns an value, a special error value of that type is returned, i.e. PAGE_ERR in SH_Data_register_page. If the return type would be void, a boolean is returned, which tells, whether the method has succeeded. (False means, that an error has occured.) The error may have occured in an intern method and is passed upwards (the stack). Internally errors are handled by an enum, but this must be considered an implementation detail and can be changed in later versions. It is in the responsibility of the caller to recover gracefully. It has to be assumed that the requested operation have neither worked, nor actually took place. Those the operation can be retried (hopefully).
Name | Last commit | Last update |
---|---|---|
.. |