Skip to content

Validation if statements in generated code should not nest #5

@tylerjw

Description

@tylerjw

Example of how they could be implemented:

if (auto const validate_result = validatefunc(param); !validate_result.success()) {
	throw std::Invalid(fmt::format("bla {}", validate_result.what()));
}
if (auto const validate_result = validatefunc2(param); !validate_result.success()) {
	throw std::Invalid(fmt::format("bla {}", validate_result.what()));
}
if (auto const validate_result = validatefunc3(param); !validate_result.success()) {
	throw std::Invalid(fmt::format("bla {}", validate_result.what()));
}
if (auto const validate_result = validatefunc4(param); !validate_result.success()) {
	throw std::Invalid(fmt::format("bla {}", validate_result.what()));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions