Skip to content

Fix DioErrorLog in the TalkerDioLogger #393

@raspberry-jenshen

Description

@raspberry-jenshen

Describe the bug
If we use TalkerDioLogger it produces DioErrorLog once the request fails.

But the parent TalkerLog fields are empty.

It produces issues because you can't use the TalkerLog abstraction; you need to cast it to DioErrorLog to log it properly.

To Reproduce
Steps to reproduce the behavior:

// setup Interceptor
final _developmentNetworkLoggerInterceptor = TalkerDioLogger(
  talker: talker,
  settings: const TalkerDioLoggerSettings(
    printRequestHeaders: true,
    printResponseHeaders: true,
  ),
);
  1. Fail Network call
  2. See the log in the debugger.

Expected behavior
Fields: logLevel, exception, stackTrace. are not null

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions