@@ -179,7 +179,11 @@ public AssetLibrary addParam(@NotNull String paramKey, @NotNull Object paramValu
179179 if (isValidKey (paramKey ) && isValidValue (paramValue )) {
180180 urlQueries .put (paramKey , paramValue );
181181 } else {
182- logger .warning ("Invalid key or value" );
182+ if (!isValidKey (paramKey )) {
183+ logger .warning (ErrorMessages .INVALID_PARAMETER_KEY );
184+ } else {
185+ logger .warning (ErrorMessages .INVALID_PARAMETER_VALUE );
186+ }
183187 }
184188 return this ;
185189 }
@@ -310,9 +314,10 @@ public void getResultObject(List<Object> objects, JSONObject jsonObject, boolean
310314
311315 List <Asset > assets = new ArrayList <>();
312316
313- // if (objects == null || objects.isEmpty()) {
314- // System.out.println("Objects list is null or empty");
315- // }
317+ if (objects == null || objects .isEmpty ()) {
318+ logger .warning (ErrorMessages .MISSING_ASSETS_LIST );
319+ return ;
320+ }
316321
317322 if (objects != null && !objects .isEmpty ()) {
318323 for (Object object : objects ) {
@@ -328,9 +333,9 @@ public void getResultObject(List<Object> objects, JSONObject jsonObject, boolean
328333 assets .add (asset );
329334 }
330335 }
331- // else {
332- // System.out.println("Object is not an instance of AssetModel" );
333- // }
336+ else {
337+ logger . warning ( ErrorMessages . INVALID_OBJECT_TYPE_ASSET_MODEL );
338+ }
334339
335340 if (callback != null ) {
336341 callback .onRequestFinish (ResponseType .NETWORK , assets );
@@ -351,7 +356,11 @@ public AssetLibrary where(String key, String value) {
351356 queryParams .put (key ,value );
352357 urlQueries .put ("query" , queryParams );
353358 } else {
354- throw new IllegalArgumentException ("Invalid key or value" );
359+ if (!isValidKey (key )) {
360+ throw new IllegalArgumentException (ErrorMessages .INVALID_PARAMETER_KEY );
361+ } else {
362+ throw new IllegalArgumentException (ErrorMessages .INVALID_PARAMETER_VALUE );
363+ }
355364 }
356365 return this ;
357366 }
0 commit comments