/**
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 .
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 */
package org.jboss.loom.ex;

import org.jboss.loom.actions.IMigrationAction;

/**
 * @author Roman Jakubco
 */
public class ActionException extends MigrationException {
    
    
    private final IMigrationAction action;
    
    
    public ActionException(IMigrationAction action, String message) {
        super(message);
        this.action = action;
    }

    public ActionException(IMigrationAction action, String message, Throwable cause) {
        super(message, cause);
        this.action = action;
    }

    public ActionException(IMigrationAction action, Throwable cause) {
        super(cause);
        this.action = action;
    }


    public IMigrationAction getAction() {
        return action;
    }
    
}// class

@@ -1260,16 +1260,759 @@
  %7D%0A    %0A
+    %0A%0A    public String formatDescription() %7B%0A        IMigrationAction action = this.getAction();%0A        // Header%0A        String description = %0A                  %22%5Cn    Migration action which caused the failure: %22%0A                + %22  (from %22 + action.getFromMigrator().getSimpleName() + %22)%22;%0A        // StackTraceElement%0A        if( action.getOriginStackTrace() != null )%0A            description += %22%5Cn%5Ctat %22 + action.getOriginStackTrace().toString();%0A        // Description%0A        description += %22%5Cn    %22 + action.toDescription();%0A        // Origin message%0A        if( action.getOriginMessage() != null )%0A            description += %22%5Cn    Purpose of the action: %22 + action.getOriginMessage();%0A        return description;%0A    %7D%0A%0A    %0A    %0A
 %7D// clas

Add ActionException#formatDescription()