-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: Converter for content type 'application/pdf' not found! #59
Comments
@saravananmnm can you please provide retrofit definition of this route? |
ApiInterface getBaseApi(final JsonRepo repo) { |
You set only jsonConverter which is for json, not for |
actually response is binary stream, how can i handle that? |
Same way :) use the right converter for the right content type, not sure jaguar have a binary stream converter so you might need to create your own |
ApiInterface getBaseApiPdf() { |
Still am getting error. can u tell the detailed script [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: Converter for content type 'application/pdf' not found! |
It's because you didn't use converters correctly, |
I don't see retrofit spec for your route. Also please format the code and use Markdown code blocks. I will take a look at it. If the response body is not deserialized, you should not get this error because jaguar should not try to serialize your data. However if you want to deserialize the response to PDF object, might need deserializing and have to provide a converter. |
you need to give the converter like: ..converters = { MimeTypes.pdf: myBinaryConverter} converter is final variable. so we cant reassign. |
You're right :) it need to be passed in the constructor as it's final my bad |
@saravananmnm You shouldn't need a converter if you just want bytes (List). |
@multipart above code is java retrofit2 with rxjava. |
kindly provide any code snippets |
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Exception: Converter for content type 'application/pdf' not found!
E/flutter ( 8390): #0 ApiClient.decodeOne (package:jaguar_retrofit/client/client.dart:23:7)
E/flutter ( 8390):
E/flutter ( 8390): #1 _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter ( 8390): #2 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 8390): #3 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 8390): #4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 8390): #5 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 8390): #6 Future._complete (dart:async/future_impl.dart:473:7)
E/flutter ( 8390): #7 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter ( 8390): #8 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
E/flutter ( 8390): #9 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
E/flutter ( 8390): #10 AsyncStringResponse.run. (package:jaguar_resty/response/response.dart)
E/flutter ( 8390):
E/flutter ( 8390): #11 _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter ( 8390): #12 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 8390): #13 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 8390): #14 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 8390): #15 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 8390): #16 Future._complete (dart:async/future_impl.dart:473:7)
E/flutter ( 8390): #17 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter ( 8390): #18 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
E/flutter ( 8390): #19 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
E/flutter ( 8390): #20 Get.go. (package:jaguar_resty/routes/routes.dart)
E/flutter ( 8390):
E/flutter ( 8390): #21 _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter ( 8390): #22 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 8390): #23 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 8390): #24 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 8390): #25 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 8390): #26 Future._completeWithValue (dart:async/future_impl.dart:483:5)
E/flutter ( 8390): #27 Future._asyncComplete. (dart:async/future_impl.dart:513:7)
E/flutter ( 8390): #28 _rootRun (dart:async/zone.dart:1124:13)
E/flutter ( 8390): #29 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 8390): #30 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter ( 8390): #31 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
E/flutter ( 8390): #32 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 8390): #33 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
Originally posted by @saravananmnm in #42 (comment)
The text was updated successfully, but these errors were encountered: