Skip to content

Commit 4f9a5e9

Browse files
authored
docs(sentry-dio): improve addSentry method documentation (#2912)
* docs(sentry-dio): improve `addSentry` method documentation with usage examples #2911 (comment) * fix(style): dartdoc dart format .
1 parent 18b7c08 commit 4f9a5e9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

dio/lib/src/sentry_dio_extension.dart

+11-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ import 'version.dart';
1414
extension SentryDioExtension on Dio {
1515
/// Adds support for automatic spans for http requests,
1616
/// as well as request and response transformations.
17-
/// This must be the last initialization step of the [Dio] setup, otherwise
18-
/// your configuration of Dio might overwrite the Sentry configuration.
17+
/// This must be the last initialization step of the [Dio] setup. Sentry will
18+
/// use your configuration, so update it first, and call `addSentry()` as the
19+
/// last step. Since Sentry does not override any user configuration, it then
20+
/// uses whatever transformer, adapter, etc., you configured [Dio] to use.
21+
///
22+
/// ```dart
23+
/// final dio = Dio();
24+
/// dio.transformer = YourCustomTransformer();
25+
/// dio.httpClientAdapter = YourCustomHttpClientAdapter();
26+
/// dio.addSentry();
27+
/// ```
1928
///
2029
/// You can also configure specific HTTP response codes to be considered
2130
/// as a failed request. In the following example, the status codes 404 and 500

0 commit comments

Comments
 (0)