-
Notifications
You must be signed in to change notification settings - Fork 54
feat: autocapture unhandled exceptions #214
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
Merged
Merged
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
592f6e2
feat: add public interface
ioannisj 23f7ba9
feat: add config and exception processor
ioannisj 7f3dc16
feat: native plugins
ioannisj 8b40927
chore: update sample app
ioannisj 7c55c87
feat: add unit tests
ioannisj b0bafda
feat: handle primitives
ioannisj 73f6e1b
chore: update changelog
ioannisj 742f23f
fix: package and module
ioannisj dd88514
feat: add autocapture integration
ioannisj 248ea91
chore: update changelog
ioannisj cf504fb
fix: format
ioannisj e137c1e
fix: format
ioannisj 6fb190d
fix: use Object vs dynamic
ioannisj 7744b92
chore: rename folder
ioannisj e32fee1
fix: make stackTrace optional
ioannisj c35cb81
fix: clean generated stack trace
ioannisj cfe8868
feat: add unit tests
ioannisj 16577ed
fix: make function optional
ioannisj f5ff9c5
fix: drop primitive check
ioannisj 2ef7146
fix: skip module
ioannisj 690bae0
fix: make thread_id optional
ioannisj 1651e5c
fix: update config
ioannisj 585a68e
fix: error type
ioannisj a5f22e4
fix: doc
ioannisj a077460
fix: handle empty stack trace
ioannisj c21b68c
fix: allow overwriting exception properties
ioannisj 19d2c19
fix: normalize props
ioannisj e3d6680
chore: bump min dart and flutter version
ioannisj 084a8b6
fix: generate event timestamp flutter side
ioannisj e5145d9
fix: remove handled from public api
ioannisj 6514ab4
fix: platform call arguments
ioannisj 821f05a
fix: example app
ioannisj 907b8ec
fix: do not try to parse exception package
ioannisj 5e19639
fix: normalize props
ioannisj 298106d
fix: normalize sets
ioannisj bdec329
fix: remove handled from public interface
ioannisj d491713
fix: web handler
ioannisj 59ed147
fix: replace hof with direct iteration
ioannisj 5a6d7d7
fix:
ioannisj 6c0529c
feat: add web support
ioannisj c4babf0
chore: add config comment
ioannisj be5ccfd
Merge branch 'feat/capture-exception' into feat/autocapture-exceptions
ioannisj fd00daf
feat: add async gap franes
ioannisj 42443b4
Revert "feat: add web support"
ioannisj edeaa36
Merge branch 'feat/capture-exception' into feat/autocapture-exceptions
ioannisj f9e9fb9
fix: simplify config
ioannisj db5f8a6
feat: add config for native autocapture
ioannisj a8bf280
fix: avoid null-assertion
ioannisj 3dca39d
fix: always restore original handlers
ioannisj cb2e261
fix: wrap error in PostHogException
ioannisj 488fedc
feat: add test cases
ioannisj bf5d806
feat: capture additional details from FlutterErrorDetails
ioannisj 4ec5010
fix: make install and uninstall methods private
ioannisj 7e331da
fix: do not modify behavior
ioannisj a9da171
feat: add current isolate error handling
ioannisj 2bea94e
fix: remove tests
ioannisj d0ee077
fix: annotate as internal
ioannisj c553ceb
fix: flutter analyze
ioannisj 61599ff
fix: do not install PlatformDispatcher.instance.onError on web
ioannisj fb4bc95
chore: update changelog
ioannisj 2c02178
Merge branch 'main' into feat/autocapture-exceptions
ioannisj 7c7fd1a
fix: build
ioannisj 042b1d0
chore: update changelog
ioannisj f06c1e2
fix: address feedback
ioannisj a9ec4ac
fix: mark IsolateErrorHandler as internal for now
ioannisj 3d06c85
fix: type inference
ioannisj 402a8ee
fix: update changelog
ioannisj 277ffb9
fix: platform check
ioannisj adf48db
chore: update sample project
ioannisj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,31 @@ | ||
| import 'dart:isolate'; | ||
|
|
||
| import 'package:meta/meta.dart'; | ||
|
|
||
| /// Native platform implementation of isolate error handling | ||
| @internal | ||
| class IsolateErrorHandler { | ||
ioannisj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| RawReceivePort? _isolateErrorPort; | ||
|
|
||
| /// Add error listener to current isolate (should be main isolate) | ||
| void addErrorListener(Function(Object?) onError) { | ||
| _isolateErrorPort = RawReceivePort(onError); | ||
| final isolateErrorPort = _isolateErrorPort; | ||
| if (isolateErrorPort != null) { | ||
| Isolate.current.addErrorListener(isolateErrorPort.sendPort); | ||
| } | ||
| } | ||
|
|
||
| /// Remove error listener and clean up | ||
| void removeErrorListener() { | ||
| final isolateErrorPort = _isolateErrorPort; | ||
| if (isolateErrorPort != null) { | ||
| isolateErrorPort.close(); | ||
| Isolate.current.removeErrorListener(isolateErrorPort.sendPort); | ||
| _isolateErrorPort = null; | ||
| } | ||
| } | ||
|
|
||
| /// Get current isolate name | ||
| String? get isolateDebugName => Isolate.current.debugName; | ||
| } | ||
This file contains hidden or 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,16 @@ | ||
| /// Web platform stub implementation of isolate error handling | ||
| /// Isolates are not available on web, so this is a no-op implementation | ||
| class IsolateErrorHandler { | ||
| /// Add error listener to current isolate (no-op on web) | ||
| void addErrorListener(Function(dynamic) onError) { | ||
| // No-op: Isolates are not available on web | ||
| } | ||
|
|
||
| /// Remove error listener and clean up (no-op on web) | ||
| void removeErrorListener() { | ||
| // No-op: Isolates are not available on web | ||
| } | ||
|
|
||
| /// Get current isolate name (always 'main' on web) | ||
| String? get isolateDebugName => 'main'; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.