// 
// Decompiled by Procyon v0.6.0
// 

package io.sentry.util;

import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.ApiStatus;

@ApiStatus.Internal
public final class ExceptionUtils
{
    @NotNull
    public static Throwable findRootCause(@NotNull final Throwable throwable) {
        Objects.requireNonNull(throwable, "throwable cannot be null");
        Throwable rootCause;
        for (rootCause = throwable; rootCause.getCause() != null && rootCause.getCause() != rootCause; rootCause = rootCause.getCause()) {}
        return rootCause;
    }
    
    @ApiStatus.Internal
    public static boolean isIgnored(@NotNull final Set<Class<? extends Throwable>> ignoredExceptionsForType, @NotNull final Throwable throwable) {
        return ignoredExceptionsForType.contains(throwable.getClass());
    }
}
