New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark transaction as internal_error
in case of unhandled errors
#1218
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## v7.0.0 #1218 +/- ##
=========================================
Coverage ? 89.04%
=========================================
Files ? 111
Lines ? 3487
Branches ? 0
=========================================
Hits ? 3105
Misses ? 382
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
||
## 7.0.0-alpha.1 | ||
|
||
### Various fixes & improvements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixing the changelog.
); | ||
} | ||
/// Parse and raise an event out of the Isolate error. | ||
@visibleForTesting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved from a standalone function to inside of the class.
// marks the span status if none to `internal_error` in case there's an | ||
// unhandled error | ||
hub.configureScope((scope) => { | ||
scope.span?.status ??= const SpanStatus.internalError(), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the added code.
@@ -20,6 +22,40 @@ class RunZonedGuardedIntegration extends Integration { | |||
/// Needed to check if we somehow caused a `print()` recursion | |||
bool _isPrinting = false; | |||
|
|||
@visibleForTesting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved to the class, to be tested.
// marks the span status if none to `internal_error` in case there's an | ||
// unhandled error | ||
hub.configureScope((scope) => { | ||
scope.span?.status ??= const SpanStatus.internalError(), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added code.
@@ -9,134 +9,170 @@ import '../mocks.mocks.dart'; | |||
import 'mock_platform_dispatcher.dart'; | |||
|
|||
void main() { | |||
TestWidgetsFlutterBinding.ensureInitialized(); | |||
group(OnErrorIntegration, () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moved within the group
final throwableMechanism = event.throwableMechanism as ThrowableMechanism; | ||
expect(throwableMechanism.mechanism.handled, true); | ||
}); | ||
test('marks transaction as internal error if no status', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
📜 Description
💡 Motivation and Context
Closes #1182
💚 How did you test it?
📝 Checklist
🔮 Next steps