package com.atlassian.bitbucket.mesh.app;

/**
 * Base class for exceptions thrown when the application cannot startup for some reason. This type is abstract to
 * ensure more distinct subclasses are used for identifying failures.
 */
public abstract class IllegalApplicationStateException
        extends IllegalStateException implements ApplicationStartupException {

    private final String action;

    protected IllegalApplicationStateException(String message, String action) {
        super(message);

        this.action = action;
    }

    protected IllegalApplicationStateException(String message, String action, Throwable cause) {
        super(message, cause);
        this.action = action;
    }

    @Override
    public String getAction() {
        return action;
    }
}
