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

play.db.evolutions.exceptions.InconsistentDatabase Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package play.db.evolutions.exceptions;

import play.exceptions.PlayException;

//Exceptions
public class InconsistentDatabase extends PlayException {
    /**
     * The name of the Database concern by the exception
     */
    private String dbName;
    private String evolutionScript;
    private String error;
    private int revision;
    private String moduleKey;

    public InconsistentDatabase(String dbName, String evolutionScript, String error, int revision, String moduleKey) {
        this.dbName = dbName;
        this.evolutionScript = evolutionScript;
        this.error = error;
        this.revision = revision;
        this.moduleKey = moduleKey;
    }
    
    public String getDbName() {
        return this.dbName;
    }
    
    public String getEvolutionScript() {
        return this.evolutionScript;
    }

    public String getError() {
        return this.error;
    }

    public int getRevision() {
        return this.revision;
    }
    

    @Override
    public String getErrorTitle() {
        return "Your database is an inconsistent state!";
    }

    @Override
    public String getErrorDescription() {
        return "An evolution has not been applied properly. Please check the problem and resolve it manually before making it as resolved.";
    }

    @Override
    public String getMoreHTML() {
        return "

This SQL script has been run, and there was a problem:

" + evolutionScript + "

This error has been thrown:

" + error + "
"; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy