Skip to content

[#14312] Add more developer friendly schema validation error#14313

Open
TobyCyan wants to merge 18 commits into
TEAMMATES:masterfrom
TobyCyan:more-friendly-schema-validation-error
Open

[#14312] Add more developer friendly schema validation error#14313
TobyCyan wants to merge 18 commits into
TEAMMATES:masterfrom
TobyCyan:more-friendly-schema-validation-error

Conversation

@TobyCyan

@TobyCyan TobyCyan commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Part of #14312

Outline of Solution

  • Add start-up error handler to retrieve and build the appropriate formatted error message with instructions.
  • Stack trace preserved in terminal as logs.
  • Gradle build will fail when an exception in thrown on start-up.
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dev-server startup error handling layer to surface developer-friendly, actionable messages (currently focused on Hibernate schema validation failures) while integrating into the Jetty startup path.

Changes:

  • Introduces StartupErrorHandler + factory/dispatcher to detect known startup exceptions and format guidance (e.g., ./gradlew liquibaseUpdate).
  • Adds a SchemaValidationStartupErrorHandler to recognize schema validation failures and build a structured message.
  • Wraps Jetty server.start() in Application to intercept startup failures and throw a dev-friendly exception; adds component tests for the new behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/main/java/teammates/main/Application.java Catches Jetty startup exceptions and routes them through the new dev startup error handler.
src/main/java/teammates/ui/errorhandlers/StartupErrorHandler.java Defines the contract for formatting startup errors into dev-friendly messages.
src/main/java/teammates/ui/errorhandlers/SchemaValidationStartupErrorHandler.java Implements schema-validation failure detection and message formatting.
src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandlerFactory.java Maps startup exceptions to the first matching handler (via reflection).
src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandler.java Throws a dev-friendly exception when a handler matches.
src/main/java/teammates/ui/errorhandlers/package-info.java Adds package-level documentation for startup error handlers.
src/main/java/teammates/ui/exception/DevServerStartupException.java Adds a dedicated runtime exception type for dev-server startup failures.
src/test/resources/testng-component.xml Includes the new UI startup error handler tests in component test suite.
src/test/java/teammates/ui/devserverstartuperrorhandlers/* Adds tests for handler detection, factory selection, and formatted message output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/teammates/ui/exception/DevServerStartupException.java
Comment thread src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandler.java Outdated
Comment thread src/main/java/teammates/ui/errorhandlers/SchemaValidationStartupErrorHandler.java Outdated
Comment thread src/main/java/teammates/ui/errorhandlers/SchemaValidationStartupErrorHandler.java Outdated
Comment thread src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandlerFactory.java Outdated
Comment thread src/main/java/teammates/main/Application.java
@TobyCyan TobyCyan marked this pull request as ready for review June 25, 2026 03:20
@TobyCyan TobyCyan requested a review from samuelfangjw June 25, 2026 04:06
Comment thread src/main/java/teammates/ui/errorhandlers/package-info.java Outdated
Comment thread src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandler.java Outdated
Comment thread src/main/java/teammates/ui/errorhandlers/DevServerStartupErrorHandler.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants