throwCheckedIf method
특정 조건(condition)이 참일 경우 CheckedException을 발생시킵니다.
주로 비즈니스 로직 검증 시 사용하며, 예측 가능한 예외를 던집니다. 호출자가 이 예외를 처리(catch)할 것으로 기대할 때 사용합니다.
Throws a CheckedException if the specified condition is true.
Primarily used for business logic validation, throwing predictable exceptions.
Implementation
T throwCheckedIf(
bool Function(T value) condition, {
required String prefix,
({String english, String locale}) message = (english: '', locale: ''),
}) {
if (condition(this)) {
throw GenericCheckedException(value: this, prefix: prefix, message: message);
}
return this;
}