Discogs: IllegalArgumentException: Missing Content-Type header in response

Bug #1332706 reported by pjv
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Collectionista
Fix Committed
High
pjv

Bug Description

No charset in HTTP response, so library throws IllegalArgumentException, which is uncaught in my app.

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)Caused by: java.lang.IllegalArgumentException: Missing Content-Type header in response
at com.google.common.base.Preconditions.void checkArgument(boolean,java.lang.Object)(Collectionista:88)
at com.google.api.client.http.HttpResponse.java.lang.Object parseAs(java.lang.Class)(Collectionista:383)
at net.lp.collectionista.apis.discogs.v2.Discogs$Release$Get.net.lp.collectionista.apis.discogs.v2.model.ReleaseResponse execute()(Collectionista:195)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$ReleaseRequestHandler.net.lp.collectionista.apis.general.Response createRequest(net.lp.collectionista.adapters.ProductHandledStore$SearchQuery,net.lp.collectionista.apis.discogs.v2.Discogs)(Collectionista:383)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$DiscogsRequestHandler.java.lang.Object makeRequest$1f7dfdec(net.lp.collectionista.adapters.ProductHandledStore$SearchQuery,net.lp.collectionista.adapters.ProductHandledStore$ResponseParser)(Collectionista:312)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$ReleaseRequestHandler.java.lang.Object handleRequest(net.lp.collectionista.adapters.ProductHandledStore$SearchQuery)(Collectionista:1)
at net.lp.collectionista.adapters.ProductHandledStore.net.lp.collectionista.adapters.ProductStore$SearchQuery buildSingleProductQuery(java.lang.String,net.lp.collectionista.adapters.ProductStore$QueryDataType,net.lp.collectionista.adapters.ProductStore$Mission)(Collectionista:167)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$SearchResultRequeryHandler$1.net.lp.collectionista.domain.items.cd.music.MusicCDItem toProduct(net.lp.collectionista.apis.discogs.v2.model.SearchResult)(Collectionista:567)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$SearchResultRequeryHandler$1.net.lp.collectionista.domain.items.cd.music.MusicCDItem sortGeneralMany(java.util.List,net.lp.collectionista.apis.discogs.v2.model.SearchResp)(Collectionista:513)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$SearchResultRequeryHandler$1.net.lp.collectionista.domain.items.cd.music.MusicCDItem parseResponse(net.lp.collectionista.apis.general.Response)(Collectionista:454)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$SearchResultRequeryHandler$1.java.lang.Object parseResponse(java.lang.Object)(Collectionista:1)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$DiscogsRequestHandler.java.lang.Object makeRequest$1f7dfdec(net.lp.collectionista.adapters.ProductHandledStore$SearchQuery,net.lp.collectionista.adapters.ProductHandledStore$ResponseParser)(Collectionista:318)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at net.lp.collectionista.adapters.DiscogsMusicCDStore$SearchResultRequeryHandler.java.lang.Object handleRequest(net.lp.collectionista.adapters.ProductHandledStore$SearchQuery)(Collectionista:1)
at net.lp.collectionista.adapters.ProductHandledStore.net.lp.collectionista.adapters.ProductStore$SearchQuery buildSingleProductQuery(java.lang.String,net.lp.collectionista.adapters.ProductStore$QueryDataType,net.lp.collectionista.adapters.ProductStore$Mission)(Collectionista:167)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at net.lp.collectionista.util.tasks.MusicCDItemScanAddTask.net.lp.collectionista.domain.items.cd.music.MusicCDItem findSingleProduct()(Collectionista:132)
at net.lp.collectionista.util.tasks.MusicCDItemScanAddTask.net.lp.collectionista.domain.Product doInBackground(java.lang.String[])(Collectionista:1)
at net.lp.collectionista.util.tasks.ScanAddTask.java.lang.Object doInBackground(java.lang.Object[])(Collectionista:1)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
... 3 more

Revision history for this message
pjv (pjv) wrote :

Fixed by catching error, also in Books and Musescore.

Changed in collectionista:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → pjv (pjv)
Revision history for this message
pjv (pjv) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.