If a fatal error state is detected when you call a CrossWorks Tasking library function then the function

void 

ctl_handle_error(CTL_ERROR_CODE_t);

will be called with a suitable error code. You must provide an implementation for this function.