Skip to content

Reduce repeated validation boilerplate and improve error reporting #18

@edunzer

Description

@edunzer

Many sequential if (...) return returnErrorWrapper(...) checks are fine, but hard to maintain and don’t tell which field failed beyond text.

How to fix: Use a List<String> errors and collect all validation errors, returning one wrapper containing all messages joined by newline. This improves Flow UX and reduces back-and-forth runs.

File: ScheduleHoursDistributor.cls (generateCategoryScheduleExceptions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions