Skip to content

Commit

Permalink
Review example
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Nov 9, 2024
1 parent 6aa0376 commit 605b8c8
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class main_form : public form {
generate_handled_exception_button.text("Generate handled exception");
generate_handled_exception_button.click += event_handler(*this, &main_form::generate_handled_exception);

generate_exception_button.auto_size(true);
generate_exception_button.location({10, 50});
generate_exception_button.parent(*this);
generate_exception_button.text("Generate exception");
generate_exception_button.click += event_handler(*this, &main_form::generate_exception);
generate_std_exception_button.auto_size(true);
generate_std_exception_button.location({10, 50});
generate_std_exception_button.parent(*this);
generate_std_exception_button.text("Generate std exception");
generate_std_exception_button.click += event_handler(*this, &main_form::generate_std_exception);

generate_system_exception_button.auto_size(true);
generate_system_exception_button.location({10, 90});
generate_system_exception_button.parent(*this);
generate_system_exception_button.text("Generate system exception");
generate_system_exception_button.click += event_handler(*this, &main_form::generate_system_exception);
generate_xtd_exception_button.auto_size(true);
generate_xtd_exception_button.location({10, 90});
generate_xtd_exception_button.parent(*this);
generate_xtd_exception_button.text("Generate xtd exception");
generate_xtd_exception_button.click += event_handler(*this, &main_form::generate_xtd_exception);

generate_unknown_exception_button.auto_size(true);
generate_unknown_exception_button.location({10, 130});
Expand All @@ -51,16 +51,16 @@ class main_form : public form {
try {
throw operation_canceled_exception {};
} catch (const system_exception& e) {
message_box::show(*this, e.message(), string::format("Exception {} handled", e.name()));
message_box::show(*this, e.message(), string::format("Exception {} handled", e.get_type().full_name()));
}
}
void generate_exception() {throw std::invalid_argument("Invalid argument");}
void generate_system_exception() {throw argument_out_of_range_exception {};}
void generate_std_exception() {throw std::invalid_argument("Invalid argument");}
void generate_xtd_exception() {throw argument_out_of_range_exception {};}
void generate_unknown_exception() {throw "Unknown exception occured";}

button generate_handled_exception_button;
button generate_exception_button;
button generate_system_exception_button;
button generate_std_exception_button;
button generate_xtd_exception_button;
button generate_unknown_exception_button;
};

Expand Down

0 comments on commit 605b8c8

Please sign in to comment.