Skip to content

Commit 94e1f49

Browse files
committed
using xtd::helpers::throw_helper class
1 parent c87cf39 commit 94e1f49

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/xtd.core/include/xtd/delegate.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ namespace xtd {
259259
if (data_->functions.size() == 0) return result_t();
260260

261261
for (size_t i = 0; i < data_->functions.size() - 1; i++) {
262-
if (data_->functions[i] == nullptr) throw xtd::argument_null_exception {};
262+
if (data_->functions[i] == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
263263
data_->functions[i]();
264264
}
265-
if (data_->functions.back() == nullptr) throw xtd::argument_null_exception {};
265+
if (data_->functions.back() == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
266266
return data_->functions.back()();
267267
}
268268

@@ -717,21 +717,21 @@ namespace xtd {
717717

718718
if (data_->no_arguments_functions.size()) {
719719
for (size_t i = 0; i < data_->no_arguments_functions.size() - (data_->functions.size() == 0 ? 1 : 0); i++) {
720-
if (data_->no_arguments_functions[i] == nullptr) throw xtd::argument_null_exception {};
720+
if (data_->no_arguments_functions[i] == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
721721
data_->no_arguments_functions[i]();
722722
}
723723

724724
if (data_->functions.size() == 0) {
725-
if (data_->no_arguments_functions.back() == nullptr) throw xtd::argument_null_exception {};
725+
if (data_->no_arguments_functions.back() == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
726726
return data_->no_arguments_functions.back()();
727727
}
728728
}
729729

730730
for (size_t i = 0; i < data_->functions.size() - 1; i++) {
731-
if (data_->functions[i] == nullptr) throw xtd::argument_null_exception {};
731+
if (data_->functions[i] == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
732732
data_->functions[i](arguments...);
733733
}
734-
if (data_->functions.back() == nullptr) throw xtd::argument_null_exception {};
734+
if (data_->functions.back() == nullptr) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_null);
735735
return data_->functions.back()(arguments...);
736736
}
737737
/// @}

src/xtd.core/include/xtd/helpers/throw_helper.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,14 @@ namespace xtd {
3636

3737
/// @brief Throws an exption with specified exception case.
3838
/// @param exception_case One of xtd::helpers::exception_case values.
39-
/// @warning Internal use only
4039
[[noreturn]] static void throws(xtd::helpers::exception_case exception_case, const source_location& location = source_location::current());
4140
/// @brief Throws an exption with specified exception case, and message.
4241
/// @param exception_case One of xtd::helpers::exception_case values.
4342
/// @param message The message associate to the exception.
44-
/// @warning Internal use only
4543
[[noreturn]] static void throws(xtd::helpers::exception_case exception_case, const char* message, const source_location& location = source_location::current());
4644
/// @brief Throws an exption with specified exception case, and message.
4745
/// @param exception_case One of xtd::helpers::exception_case values.
4846
/// @param type The type associate to the exception.
49-
/// @warning Internal use only
5047
[[noreturn]] static void throws(xtd::helpers::exception_case exception_case, const xtd::type& type, const source_location& location = source_location::current());
5148
};
5249
}

0 commit comments

Comments
 (0)