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

io.debezium.util.Throwables Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
/*
 * Copyright Debezium Authors.
 *
 * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
 */
package io.debezium.util;

/**
 * Functionality for dealing with {@link Throwable}s.
 *
 * @author Gunnar Morling
 */
public class Throwables {

    public static Throwable getRootCause(Throwable throwable) {
        while (true) {
            Throwable cause = throwable.getCause();
            if (cause == null) {
                return throwable;
            }
            throwable = cause;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy