✨ Introduce `DioExceptionLogBuilder`
Resolves https://github.com/cfug/dio/issues/1949 Resolves https://github.com/cfug/dio/issues/2287
Developers may want the URL of the exception to know what endpoint has gone wrong, or they want to have fewer tips about what the status code means. If we open too many flags to support various logging content, it will be a mess eventually.
Introducing the DioExceptionLogBuilder easily builds text content from the DioException.
New Pull Request Checklist
- [ ] I have read the Documentation
- [ ] I have searched for a similar pull request in the project and found none
- [ ] I have updated this branch with the latest
mainbranch to avoid conflicts (via merge from master or rebase) - [ ] I have added the required tests to prove the fix/feature I'm adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures
- [ ] I have updated the
CHANGELOG.mdin the corresponding package
I guess we can go for the builder, any thought about this? @ueman @kuhnroyal
I think this is good, same goes for the log level.
Code Coverage Report: Only Changed Files listed
| Package | Base Coverage | New Coverage | Difference |
|---|---|---|---|
| dio/lib/src/dio_exception.dart | 🟢 92.98% | 🟢 89.39% | 🔴 -3.59% |
| dio/lib/src/utils.dart | 🟢 98.28% | 🟢 98.31% | 🟢 0.03% |
| Overall Coverage | 🟢 84.82% | 🟢 84.74% | 🔴 -0.08% |
Minimum allowed coverage is 0%, this run produced 84.74%