cpp:exception_inheritance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
cpp:exception_inheritance [2020/05/04 12:04]
gthanos
cpp:exception_inheritance [2020/05/04 12:06]
gthanos
Line 55: Line 55:
     }     }
   } catch(BaseException ex) {   } catch(BaseException ex) {
-    cout << ex.what();+    cout << ex.message();
   } catch(DerivedException ex) {   } catch(DerivedException ex) {
-    cout << ex.what();+    cout << ex.message();
   }   }
   return 0;   return 0;
Line 112: Line 112:
     }     }
   } catch(BaseException &ex) {   } catch(BaseException &ex) {
-    cout << ex.what();+    cout << ex.message();
   } catch(DerivedException &ex) {   } catch(DerivedException &ex) {
-    cout << ex.what();+    cout << ex.message();
   }   }
   return 0;   return 0;
cpp/exception_inheritance.txt · Last modified: 2023/05/15 14:08 by gthanos