All Downloads are FREE. Search and download functionalities are using the official Maven repository.

play.db.ebean.dbmigration.MigrationRunnerError.scala Maven / Gradle / Ivy

The newest version!
package play.db.ebean.dbmigration

import java.sql.SQLException

import play.api.PlayException

/**
  * InvalidDatabaseRevision.
  *
  * @param db           The database name
  * @param sqlException The SQL exception
  * @since 17.01.29
  * @author Thibault Meyer
  */
case class MigrationRunnerError(db: String, sqlException: SQLException) extends PlayException.RichDescription(
  "Migration error on database '" + db + "'", "Ebean DB Migration", sqlException) {

  def subTitle: String = "Error details"

  def content: String =
    s"""Database: $db
       |SQLState: ${if (sqlException.getSQLState != null) sqlException.getSQLState else "-"}
       |Error Code: ${sqlException.getErrorCode}""".stripMargin

  def htmlDescription: String = s"${sqlException.getMessage}".stripMargin
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy