Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ internal class RegexExtractor(

// we *find* any match within the source string rather than require a full match
if (matcher.find()) {
output(extractGroups(stringValue, matcher))
output(extractMatcherOutput(stringValue, matcher))
}
}
}

private fun extractGroups(
private fun extractMatcherOutput(
source: String,
matcher: Matcher
): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Handler
import android.os.Looper
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration
import java.io.IOException

class RemoteConfigBasicScenario(
config: Configuration,
Expand All @@ -16,8 +17,10 @@ class RemoteConfigBasicScenario(
override fun startScenario() {
super.startScenario()
Bugsnag.notify(RuntimeException("Handled exception"))
handler.postDelayed({
throw RuntimeException("Unhandled exception")
}, 3000)

Thread {
Thread.sleep(3000)
throw IOException("Unhandled exception")
}.start()
}
}
28 changes: 21 additions & 7 deletions features/full_tests/remote_config_discard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Remote config discard rules are applied
And the received errors match:
| exceptions.0.errorClass | exceptions.0.message |
| java.lang.RuntimeException | Handled exception |
| java.lang.RuntimeException | Unhandled exception |
| java.io.IOException | Unhandled exception |
Then the report contains the required fields
And the event "severity" equals "warning"
And the event "unhandled" is false
Expand All @@ -38,7 +38,7 @@ Feature: Remote config discard rules are applied
And the received errors match:
| exceptions.0.errorClass | exceptions.0.message |
| java.lang.RuntimeException | Handled exception |
| java.lang.RuntimeException | Unhandled exception |
| java.io.IOException | Unhandled exception |
Then the report contains the required fields
And the event "severity" equals "warning"
And the event "unhandled" is false
Expand All @@ -58,8 +58,8 @@ Feature: Remote config discard rules are applied
And I configure Bugsnag for "RemoteConfigBasicScenario"
And I wait to receive an error
And the received errors match:
| exceptions.0.errorClass | exceptions.0.message |
| java.lang.RuntimeException | Unhandled exception |
| exceptions.0.errorClass | exceptions.0.message |
| java.io.IOException | Unhandled exception |
Then the report contains the required fields
And the event "severity" equals "error"
And the event "unhandled" is true
Expand Down Expand Up @@ -108,8 +108,22 @@ Feature: Remote config discard rules are applied
And I configure Bugsnag for "RemoteConfigBasicScenario"
And I wait to receive an error
And the received errors match:
| exceptions.0.errorClass | exceptions.0.message |
| java.lang.RuntimeException | Unhandled exception |
| exceptions.0.errorClass | exceptions.0.message |
| java.io.IOException | Unhandled exception |
Then the report contains the required fields
And the event "severity" equals "error"
And the event "unhandled" is true
And the event "unhandled" is true

Scenario: Remote config with errorClass HASH discard
When I prepare an error config with:
| type | name | value |
| property | body | @features/support/config/rules_hash_ioexception.json |
| property | status | 200 |
| header | Cache-Control | max-age=604800 |
And I run "RemoteConfigBasicScenario"
And I relaunch the app after a crash
And I configure Bugsnag for "RemoteConfigBasicScenario"
And I wait to receive 1 errors
And the received errors match:
| exceptions.0.errorClass | exceptions.0.message |
| java.lang.RuntimeException | Handled exception |
17 changes: 17 additions & 0 deletions features/support/config/rules_hash_ioexception.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"discardRules": [
{
"matchType": "HASH",
"hash": {
"paths": [
{
"path": "exceptions.0.errorClass"
}
],
"matches": [
"69031b9271bad3ba9c92ca2440902e5fa1010799"
]
}
}
]
}