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

io.katharsis.utils.PropertyException Maven / Gradle / Ivy

There is a newer version: 2.6.3
Show newest version
package io.katharsis.utils;

import io.katharsis.errorhandling.exception.KatharsisException;

/**
 * Indicate an exception when accessing resource properties
 */
public class PropertyException extends KatharsisException {

    private final Throwable cause;
    private final Class resourceClass;
    private final String field;

    public PropertyException(Throwable cause, Class resourceClass, String field) {
        super(cause.getMessage());
        this.cause = cause;
        this.resourceClass = resourceClass;
        this.field = field;
    }

    public PropertyException(String message, Class resourceClass, String field) {
        super(message);
        this.cause = this;
        this.resourceClass = resourceClass;
        this.field = field;
    }

    @Override
    public Throwable getCause() {
        return cause;
    }

    public Class getResourceClass() {
        return resourceClass;
    }

    public String getField() {
        return field;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy