Skip to content
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

[Proposal] Improve toString() of InterceptorState #2226

Closed
navaronbracke opened this issue May 28, 2024 · 0 comments · Fixed by #2247
Closed

[Proposal] Improve toString() of InterceptorState #2226

navaronbracke opened this issue May 28, 2024 · 0 comments · Fixed by #2247
Labels
s: feature This issue indicates a feature request

Comments

@navaronbracke
Copy link

navaronbracke commented May 28, 2024

Request Statement

When Firebase Crashlytics gets an error report from code within a request interceptor,
the information from the log is very limited.

For example:

// Crashlytics report header
DioMixin.request
io.flutter.plugins.firebase.crashlytics.FlutterError - Instance of 'InterceptorState<DioException>'

// Raw stacktrace
      Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Instance of 'InterceptorState<DioException>'
       at DioMixin.request(dio_mixin.dart:350)
       at DioMixin.get(dio_mixin.dart:64)
       at HttpChatRepository.getChatMessages(http_chat_repository.dart:12)
       at ChatNotifier.fetchMessages(chat_notifier.dart:38)
       at PollingManager._queue(polling_manager.dart:19)
       at PollingManager.startPolling.<fn>(polling_manager.dart:32)

Solution Brainstorm

Instead of having InterceptorState<T> use the default toString() implementation,
which is Instance of 'InterceptorState<DioException>',
provide the error details of the underlying DioException in the toString() implementation,
by implementing toString() in

class InterceptorState<T> {

and providing the details of the DioException in the toString() implementation.

@navaronbracke navaronbracke added the s: feature This issue indicates a feature request label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: feature This issue indicates a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant