File tree Expand file tree Collapse file tree
arc-utils/src/main/java/fr/insee/arc/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ public enum ArcExceptionMessage {
66
77 FILE_IS_EMPTY ("Le fichier %s est vide" ),
88 FILE_RENAME_FAILED ("Le fichier %s n'a pas pu être renommé vers %s " ),
9- FILE_COPY_FAILED ("Le fichier %s n'a pas pu être copié vers %s " ),
9+ FILE_S3_OPERATION_FAILED ("Erreur operation s3 : %s %s" ),
10+ FILE_COPY_FAILED ("Le fichier %s n'a pas pu être copié vers %s" ),
11+ FILE_COPY_FAILED_RETRY ("Le fichier %s n'a pas pu être copié vers %s - RETRY %s" ),
1012 FILE_DELETE_FAILED ("Le fichier %s n'a pas pu être effacé" ),
13+ FILE_DELETE_FAILED_RETRY ("Le fichier %s n'a pas pu être effacé - RETRY %s" ),
1114 FILE_READ_FAILED ("Le fichier %s n'a pas pu être lu" ),
1215 FILE_EXTRACT_FAILED ("Le fichier archive %s n'a pas pu être extrait" ),
1316 FILE_WRITE_FAILED ("Le fichier %s n'a pas pu être écrit" ),
Original file line number Diff line number Diff line change 1+ package fr .insee .arc .utils .minio ;
2+
3+ import java .io .IOException ;
4+
5+ import org .apache .logging .log4j .LogManager ;
6+ import org .apache .logging .log4j .Logger ;
7+
8+ import fr .insee .arc .utils .utils .LoggerHelper ;
9+ import okhttp3 .Interceptor ;
10+ import okhttp3 .Response ;
11+
12+ public class OkHttpInterceptor implements Interceptor {
13+
14+ private static final Logger LOGGER = LogManager .getLogger (S3Template .class );
15+
16+
17+ public OkHttpInterceptor () {
18+ }
19+
20+ @ Override
21+ public Response intercept (Chain chain ) throws IOException {
22+
23+ Response response = chain .proceed (chain .request ());
24+
25+ if (!response .isSuccessful () && response .code ()!=404 ) {
26+ LoggerHelper .error (LOGGER , "Error okhttp : " + response );
27+ }
28+
29+ return response ;
30+ }
31+
32+ }
You can’t perform that action at this time.
0 commit comments