TranslationFailure.java 1.3 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.jcr.Node
 *  javax.jcr.RepositoryException
 */
package com.adobe.cq.wcm.translation.impl;

import javax.jcr.Node;
import javax.jcr.RepositoryException;

public class TranslationFailure {
    private Node node;
    private String strPropertyName;
    private String strPropertyText;
    private Exception raisedException;

    TranslationFailure(Node failedNode, String strPropName, String strPropValue, Exception exp) {
        this.node = failedNode;
        this.strPropertyName = strPropName;
        this.strPropertyText = strPropValue;
        this.raisedException = exp;
    }

    public String toString() {
        String strRetVal;
        try {
            strRetVal = "Error while translating " + this.node.getPath() + " Property Name is " + this.strPropertyName;
            if (this.raisedException != null) {
                strRetVal = strRetVal + " Error is " + this.raisedException.toString();
            }
            if (this.strPropertyText != null) {
                strRetVal = strRetVal + " Property Value is " + this.strPropertyText;
            }
        }
        catch (RepositoryException e) {
            strRetVal = "Error while generating toString for Failure";
        }
        return strRetVal;
    }
}