Ignore:
Timestamp:
Aug 10, 2023, 10:24:06 PM (15 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
09a767e
Parents:
7839f78
Message:

fix error when exception propagation does not find a handler and print appropriate message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.c

    r7839f78 r13600e8  
    1010// Created On       : Mon Jun 26 15:13:00 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 27 09:45:57 2023
    13 // Update Count     : 37
     12// Last Modified On : Thu Aug 10 16:45:22 2023
     13// Update Count     : 69
    1414//
    1515
     
    2727#include "stdhdr/assert.h"
    2828#include "virtual.h"
     29
     30extern void __cabi_abort( const char fmt[], ... );
    2931
    3032#pragma GCC visibility push(default)
     
    192194
    193195        if ( actions & _UA_END_OF_STACK ) {
    194                 abort();
     196                __cabi_abort(
     197                        "Propagation failed to find a matching handler.\n"
     198                        "Possible cause is a missing try block with appropriate catch clause for specified exception type.\n"
     199                        "Last exception name or message: %s.\n",
     200                        NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) )->
     201                                virtual_table->msg( NODE_TO_EXCEPT( UNWIND_TO_NODE( unwind_exception ) ) )
     202                );
    195203        } else {
    196204                return _URC_NO_REASON;
     
    209217        struct exception_context_t * context = this_exception_context();
    210218        struct __cfaehm_node * node = EXCEPT_TO_NODE(context->current_exception);
    211 
    212         // Preform clean-up of any extra active exceptions.
    213         while ( node->next ) {
    214                 struct __cfaehm_node * to_free = node->next;
    215                 node->next = to_free->next;
    216                 exception_t * except = NODE_TO_EXCEPT( to_free );
    217                 except->virtual_table->free( except );
    218             free( to_free );
    219         }
    220219
    221220        _Unwind_Reason_Code ret;
Note: See TracChangeset for help on using the changeset viewer.