70 lines
2.0 KiB
Java
70 lines
2.0 KiB
Java
|
package okhttp3.internal.cache;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import o.AbstractC15151gif;
|
||
|
import o.C14866gag;
|
||
|
import o.C14957gcv;
|
||
|
import o.C15111ghZ;
|
||
|
import o.InterfaceC14894gbR;
|
||
|
import o.InterfaceC15168giw;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public class FaultHidingSink extends AbstractC15151gif {
|
||
|
private boolean hasErrors;
|
||
|
private final InterfaceC14894gbR<IOException, C14866gag> onException;
|
||
|
|
||
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public FaultHidingSink(InterfaceC15168giw interfaceC15168giw, InterfaceC14894gbR<? super IOException, C14866gag> interfaceC14894gbR) {
|
||
|
super(interfaceC15168giw);
|
||
|
C14957gcv.e(interfaceC15168giw, "");
|
||
|
C14957gcv.e(interfaceC14894gbR, "");
|
||
|
this.onException = interfaceC14894gbR;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15151gif, o.InterfaceC15168giw
|
||
|
public void write(C15111ghZ c15111ghZ, long j) {
|
||
|
C14957gcv.e(c15111ghZ, "");
|
||
|
if (this.hasErrors) {
|
||
|
c15111ghZ.j(j);
|
||
|
return;
|
||
|
}
|
||
|
try {
|
||
|
super.write(c15111ghZ, j);
|
||
|
} catch (IOException e) {
|
||
|
this.hasErrors = true;
|
||
|
this.onException.invoke(e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15151gif, o.InterfaceC15168giw, java.io.Flushable
|
||
|
public void flush() {
|
||
|
if (this.hasErrors) {
|
||
|
return;
|
||
|
}
|
||
|
try {
|
||
|
super.flush();
|
||
|
} catch (IOException e) {
|
||
|
this.hasErrors = true;
|
||
|
this.onException.invoke(e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC15151gif, o.InterfaceC15168giw, java.io.Closeable, java.lang.AutoCloseable
|
||
|
public void close() {
|
||
|
if (this.hasErrors) {
|
||
|
return;
|
||
|
}
|
||
|
try {
|
||
|
super.close();
|
||
|
} catch (IOException e) {
|
||
|
this.hasErrors = true;
|
||
|
this.onException.invoke(e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final InterfaceC14894gbR<IOException, C14866gag> getOnException() {
|
||
|
return this.onException;
|
||
|
}
|
||
|
}
|