package com.helpshift.network.exception; /* loaded from: classes3.dex */ public class HSRootApiException extends RuntimeException { public final String errorMessage; public final Exception exception; public final ExceptionType exceptionType; public interface ExceptionType { } public HSRootApiException(Exception exc, ExceptionType exceptionType, String str) { super(str, exc); this.exception = exc; this.exceptionType = exceptionType; this.errorMessage = str; } public static HSRootApiException wrap(Exception exc, ExceptionType exceptionType) { return wrap(exc, exceptionType, null); } public static HSRootApiException wrap(Exception exc, ExceptionType exceptionType, String str) { if (exc instanceof HSRootApiException) { HSRootApiException hSRootApiException = (HSRootApiException) exc; Exception exc2 = hSRootApiException.exception; if (exceptionType == null) { exceptionType = hSRootApiException.exceptionType; } if (str == null) { str = hSRootApiException.errorMessage; } exc = exc2; } else if (exceptionType == null) { exceptionType = UnexpectedException.GENERIC; } return new HSRootApiException(exc, exceptionType, str); } }