Skip to content

Validate START_QTR and END_QTR on startup #269

Description

@pconrad

Special Note

Be sure to coordinate with whoever is working on the issue Determine END_QTR from the current quarter so that you are not working at cross purposes. It's probably best for one person to work on these two issues, and decide what order to do them in.

Description

The values for START_QTR and END_QTR should be validated on startup.

If they are not valid values, the application should either refuse to startup,
or fall back to defaults.

Valid values for the START_QTR and END_QTR begin with a year that
is between 1980 and 2050, and end with either 1,2,3 or 4.

This logic should probably go in CoursesStartup.java above this line:

And instead of catching an exception and logging the issue, you should probably log the issue, and then throw an uncaught RuntimeException that will halt the application.

For the validation you may be able to reuse a method from this file, so check here first before writing your own custom code to do the validation:

https://github.com/ucsb-cs156/proj-courses/blob/main/src/main/java/edu/ucsb/cs156/courses/models/Quarter.java

Make sure that the error message that is logged is helpful to future students that may run into the problem that the application doesn't start due to an invalid value for START_QTR or END_QTR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions