Skip to content

Commit

Permalink
change breadcrumb type and level
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Oct 24, 2023
1 parent e58a4d8 commit af3d295
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 62 deletions.
8 changes: 4 additions & 4 deletions sqflite/lib/src/sentry_batch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class SentryBatch implements Batch {

breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -133,8 +133,8 @@ class SentryBatch implements Batch {

breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down
8 changes: 4 additions & 4 deletions sqflite/lib/src/sentry_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -183,8 +183,8 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down
48 changes: 24 additions & 24 deletions sqflite/lib/src/sentry_database_executor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -110,12 +110,12 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -174,8 +174,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -253,8 +253,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -334,8 +334,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -378,8 +378,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -422,8 +422,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -470,8 +470,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -523,8 +523,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -567,8 +567,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down Expand Up @@ -630,8 +630,8 @@ class SentryDatabaseExecutor implements DatabaseExecutor {
span?.status = SpanStatus.internalError();
breadcrumb.data?['status'] = 'internal_error';
breadcrumb = breadcrumb.copyWith(
type: 'error',
level: SentryLevel.error,
type: 'query',
level: SentryLevel.warning,
);

rethrow;
Expand Down
8 changes: 4 additions & 4 deletions sqflite/test/sentry_batch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ SELECT * FROM Product''';

final breadcrumb = fixture.hub.scope.breadcrumbs.last;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('apply sets span to internal error if its thrown', () async {
Expand Down Expand Up @@ -646,8 +646,8 @@ SELECT * FROM Product''';

final breadcrumb = fixture.hub.scope.breadcrumbs.last;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});
});
}
Expand Down
52 changes: 26 additions & 26 deletions sqflite/test/sentry_database_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('transaction sets span to internal error', () async {
Expand Down Expand Up @@ -281,8 +281,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});
});

Expand Down Expand Up @@ -1007,8 +1007,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('execute sets breadcrumb to internal error', () async {
Expand All @@ -1023,8 +1023,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('insert sets breadcrumb to internal error', () async {
Expand All @@ -1040,8 +1040,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('query sets breadcrumb to internal error', () async {
Expand All @@ -1056,8 +1056,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('query cursor sets breadcrumb to internal error', () async {
Expand All @@ -1072,8 +1072,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('raw delete sets breadcrumb to internal error', () async {
Expand All @@ -1088,8 +1088,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('raw insert sets breadcrumb to internal error', () async {
Expand All @@ -1104,8 +1104,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('raw query sets breadcrumb to internal error', () async {
Expand All @@ -1120,8 +1120,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('raw query cursor sets breadcrumb to internal error', () async {
Expand All @@ -1137,8 +1137,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('raw update sets breadcrumb to internal error', () async {
Expand All @@ -1153,8 +1153,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});

test('update sets breadcrumb to internal error', () async {
Expand All @@ -1170,8 +1170,8 @@ void main() {

final breadcrumb = fixture.hub.scope.breadcrumbs.first;
expect(breadcrumb.data?['status'], 'internal_error');
expect(breadcrumb.type, 'error');
expect(breadcrumb.level, SentryLevel.error);
expect(breadcrumb.type, 'query');
expect(breadcrumb.level, SentryLevel.warning);
});
});
}
Expand Down

0 comments on commit af3d295

Please sign in to comment.