crossminer / scava

https://eclipse.org/scava/
Eclipse Public License 2.0
18 stars 13 forks source link

RESTMULE ERROR: http error code: 404 RESTMULE CAN ONLY HANDLE: 403 and [502] #452

Closed luismpaiva closed 4 years ago

luismpaiva commented 4 years ago

CC: @MarcioMateus

When trying to access to API of a repo fork that does not exists, RESTMULE throws an Exception as described below.

How can we handle this?

Plase see our log from this case: AbstractInterceptor.intercept( https://api.github.com/repos/cha63506/HX711/commits?per_page=100&page=1 ) 17:44:57.952 [OkHttp https://api.github.com/...] ERROR org.eclipse.scava.crossflow.restmule.core.interceptor.AbstractInterceptor - RESTMULE ERROR: http error code: 404 RESTMULE CAN ONLY HANDLE: 403 and [502] Exception in thread "pool-4-thread-1" java.lang.UnsupportedOperationException: Do not know how to handle this type of error code: 404 at org.eclipse.scava.crossflow.restmule.core.interceptor.AbstractInterceptor$1.intercept(AbstractInterceptor.java:228) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

barmpis commented 4 years ago

Updated restmule (crossflow branch + updatesite) to handle 404 by giving a warning and returning nothing for that call (instead of throwing an exception)

creat89 commented 4 years ago

I will try to update the GitHub reader with the updated version of Restmule in the following days