-
-
Notifications
You must be signed in to change notification settings - Fork 277
Implement error type identifier to mitigate obfuscated Flutter issue titles #2170
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 4 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5e26214
try to mitigate runtime type not being obfuscated
buenaflor c3d307f
fix imports
buenaflor aa007d4
Remove prints
buenaflor 526102e
Update
buenaflor 745a18f
Update
buenaflor 34c4e11
Update exception_type_identifier.dart
buenaflor df9c16e
Add caching
buenaflor ff04d22
Update
buenaflor 4fb9c86
split up dart:io and dart:html exceptions
buenaflor 4aaa838
Merge branch 'main' into improvement/flutter-issues-title
buenaflor 04dace5
fix analyze
buenaflor 40fba24
Update CHANGELOG
buenaflor 51e25c0
update
buenaflor bc25f48
Add more tests
buenaflor fe9144f
Update docs
buenaflor c22636f
Update options docs
buenaflor f9da0a4
remove print
buenaflor 0305205
remove CustomException
buenaflor facc3ba
import with show
buenaflor c31fee1
try fix test
buenaflor 5eeeef9
Update CHANGELOG.md
buenaflor 7398345
Merge branch 'main' into improvement/flutter-issues-title
buenaflor cee56f3
Update CHANGELOG.md
buenaflor 1845eba
Fix analyze
buenaflor b15dcf8
try fix test
buenaflor 95d53f9
Update CHANGELOG.md
buenaflor 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import '../sentry.dart'; | ||
|
|
||
| class DartErrorIdentifier implements ErrorTypeIdentifier { | ||
| @override | ||
| String? getTypeName(dynamic error) { | ||
| if (error is NoSuchMethodError) return 'NoSuchMethodError'; | ||
| if (error is FormatException) return 'FormatException'; | ||
| if (error is TypeError) return 'TypeError'; | ||
| if (error is ArgumentError) return 'ArgumentError'; | ||
| if (error is StateError) return 'StateError'; | ||
| if (error is UnsupportedError) return 'UnsupportedError'; | ||
| if (error is UnimplementedError) return 'UnimplementedError'; | ||
| if (error is ConcurrentModificationError) | ||
| return 'ConcurrentModificationError'; | ||
| if (error is OutOfMemoryError) return 'OutOfMemoryError'; | ||
| if (error is StackOverflowError) return 'StackOverflowError'; | ||
| return null; | ||
| } | ||
| } | ||
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,3 @@ | ||
| abstract class ErrorTypeIdentifier { | ||
| String? getTypeName(dynamic error); | ||
| } |
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,17 @@ | ||
| import 'package:flutter/cupertino.dart'; | ||
| import 'package:flutter/services.dart'; | ||
|
|
||
| import '../sentry_flutter.dart'; | ||
|
|
||
| class FlutterErrorIdentifier implements ErrorTypeIdentifier { | ||
| @override | ||
| String? getTypeName(dynamic error) { | ||
| if (error is FlutterError) return 'FlutterError'; | ||
| if (error is PlatformException) return 'PlatformException'; | ||
| if (error is MissingPluginException) return 'MissingPluginException'; | ||
| if (error is AssertionError) return 'AssertionError'; | ||
| if (error is NetworkImageLoadException) return 'NetworkImageLoadException'; | ||
| if (error is TickerCanceled) return 'TickerCanceled'; | ||
| return null; | ||
| } | ||
| } |
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
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.