[Java API] Error Listing Sale/Discount PackageRefs


#1

I got around to implementing the ability to add/remove packages to a sale or discount through my plugin. I list all of the ShopPackageRefs of a sale or discount in order to determine if whatever package the user is trying to add to it is already there. In doing so, I got the “Endpoint not found error” that is shown below -

Methods Used:

@GET("/shop/{sid}/discount/{discount}/packageRef")
CompletableFuture<Cursor<ShopDiscountPackageRef>> getDiscountPackageRefs(@Path("sid") String shopId, @Path("discount") String discountId, @Query("page") int page, @Query("perpage") int perPage);

and

@GET("/shop/{sid}/sale/{sale}/packageRef")
CompletableFuture<Cursor<ShopSalePackageRef>> getSalePackageRefs(@Path("sid") String shopId, @Path("sale") String saleId, @Query("page") int page, @Query("perpage") int perPage);

Error Messages:

Stack Traces:

Listing Sale PackageRefs:

02.09 12:52:48 [Server] WARN java.util.concurrent.CompletionException: co.melondev.cubedpay.CubedPayException: Endpoint not found
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture.uniAccept(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
02.09 12:52:48 [Server] WARN at retrofit2.adapter.java8.Java8CallAdapterFactory$BodyCallAdapter$2.onFailure(Java8CallAdapterFactory.java:114)
02.09 12:52:48 [Server] WARN at retrofit2.OkHttpCall$1.callFailure(OkHttpCall.java:135)
02.09 12:52:48 [Server] WARN at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:118)
02.09 12:52:48 [Server] WARN at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
02.09 12:52:48 [Server] WARN at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
02.09 12:52:48 [Server] WARN at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
02.09 12:52:48 [Server] WARN at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
02.09 12:52:48 [Server] WARN at java.lang.Thread.run(Unknown Source)
02.09 12:52:48 [Server] WARN Caused by: co.melondev.cubedpay.CubedPayException: Endpoint not found
02.09 12:52:48 [Server] WARN at co.melondev.cubedpay.envelope.APIEnvelopeTransformerConverter.convert(APIEnvelopeTransformerConverter.java:40)
02.09 12:52:48 [Server] WARN at co.melondev.cubedpay.envelope.APIEnvelopeTransformerConverter.convert(APIEnvelopeTransformerConverter.java:13)
02.09 12:52:48 [Server] WARN at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:122)
02.09 12:52:48 [Server] WARN at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:217)
02.09 12:52:48 [Server] WARN at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:116)
02.09 12:52:48 [Server] WARN ... 5 more

Listing Discount PackageRefs:

02.09 12:53:44 [Server] WARN java.util.concurrent.CompletionException: co.melondev.cubedpay.CubedPayException: Endpoint not found
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture.uniAccept(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
02.09 12:53:44 [Server] WARN at retrofit2.adapter.java8.Java8CallAdapterFactory$BodyCallAdapter$2.onFailure(Java8CallAdapterFactory.java:114)
02.09 12:53:44 [Server] WARN at retrofit2.OkHttpCall$1.callFailure(OkHttpCall.java:135)
02.09 12:53:44 [Server] WARN at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:118)
02.09 12:53:44 [Server] WARN at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
02.09 12:53:44 [Server] WARN at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
02.09 12:53:44 [Server] WARN at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
02.09 12:53:44 [Server] WARN at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
02.09 12:53:44 [Server] WARN at java.lang.Thread.run(Unknown Source)
02.09 12:53:44 [Server] WARN Caused by: co.melondev.cubedpay.CubedPayException: Endpoint not found
02.09 12:53:44 [Server] WARN at co.melondev.cubedpay.envelope.APIEnvelopeTransformerConverter.convert(APIEnvelopeTransformerConverter.java:40)
02.09 12:53:44 [Server] WARN at co.melondev.cubedpay.envelope.APIEnvelopeTransformerConverter.convert(APIEnvelopeTransformerConverter.java:13)
02.09 12:53:44 [Server] WARN at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:122)
02.09 12:53:44 [Server] WARN at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:217)
02.09 12:53:44 [Server] WARN at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:116)
02.09 12:53:44 [Server] WARN ... 5 more