-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enha/ui-integration-tests
- Loading branch information
Showing
9 changed files
with
103 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,4 @@ sentry: | |
wait_for_processing: true | ||
commits: true | ||
ignore_missing: true | ||
log_level: info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import 'package:min_version_test/transaction/transaction.dart'; | ||
import 'dart:io'; | ||
|
||
import 'package:logging/logging.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
import 'package:sentry_dio/sentry_dio.dart'; | ||
|
||
class FileTransaction implements Transaction { | ||
@override | ||
Future<void> start() async { | ||
final transaction = Sentry.startTransaction( | ||
'incrementCounter', | ||
'task', | ||
bindToScope: true, | ||
); | ||
|
||
final dio = Dio(); | ||
dio.addSentry(); | ||
final log = Logger('_MyHomePageState'); | ||
|
||
try { | ||
final file = File('response.txt'); | ||
final response = await dio.get<String>('https://flutter.dev/'); | ||
await file.writeAsString(response.data ?? 'no response'); | ||
|
||
await transaction.finish(status: SpanStatus.ok()); | ||
} catch (exception, stackTrace) { | ||
log.info(exception.toString(), exception, stackTrace); | ||
await transaction.finish(status: SpanStatus.internalError()); | ||
} | ||
} | ||
} | ||
|
||
Transaction getTransaction() => FileTransaction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class Transaction { | ||
Future<void> start() async { | ||
// Do nothing... | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import 'package:min_version_test/transaction/transaction.dart'; | ||
|
||
Transaction getTransaction() => | ||
throw UnsupportedError('Cannot create sample transaction.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:min_version_test/transaction/transaction.dart'; | ||
|
||
import 'package:logging/logging.dart'; | ||
import 'package:dio/dio.dart'; | ||
|
||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
import 'package:sentry_dio/sentry_dio.dart'; | ||
|
||
class WebTransaction implements Transaction { | ||
@override | ||
Future<void> start() async { | ||
final transaction = Sentry.startTransaction( | ||
'incrementCounter', | ||
'task', | ||
bindToScope: true, | ||
); | ||
|
||
final dio = Dio(); | ||
dio.addSentry(); | ||
final log = Logger('_MyHomePageState'); | ||
|
||
try { | ||
final response = await dio.get<String>('https://flutter.dev/'); | ||
print(response); | ||
|
||
await transaction.finish(status: SpanStatus.ok()); | ||
} catch (exception, stackTrace) { | ||
log.info(exception.toString(), exception, stackTrace); | ||
await transaction.finish(status: SpanStatus.internalError()); | ||
} | ||
} | ||
} | ||
|
||
Transaction getTransaction() => WebTransaction(); |
Empty file.