Skip to content

Commit 49de94a

Browse files
committed
build: Sentry 5.1.0
1 parent 11b0558 commit 49de94a

4 files changed

Lines changed: 20 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Housekeeping
88

9+
- Sentry 4.2.0 -> 5.1.0
910
- Gradle 6.8.3 -> 7.2
1011

1112
## [0.11.0] (2021-02-23)

buildSrc/src/main/kotlin/dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@file:Suppress("ClassName")
22

3-
const val sentry = "io.sentry:sentry:4.2.0"
3+
const val sentry = "io.sentry:sentry:5.1.1"
44

55
object fuel {
66
private const val group = "com.github.kittinunf.fuel"

inspector-sentry-reporter/src/main/kotlin/SentryReporter.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package ru.endlesscode.inspector.report
22

3+
import io.sentry.EventProcessor
34
import io.sentry.Integration
45
import io.sentry.Sentry
56
import io.sentry.SentryEvent
@@ -27,12 +28,14 @@ public class SentryReporter private constructor(
2728
options.addInAppInclude(focus.focusedPackage)
2829
options.enableUncaughtExceptionHandler = false
2930
integrations.forEach(options::addIntegration)
30-
options.addEventProcessor { event, _ ->
31-
fields.asSequence()
32-
.filter(ReportField::show)
33-
.forEach { event.setExtra(it.name, it.value) }
34-
event
35-
}
31+
options.addEventProcessor(object : EventProcessor {
32+
override fun process(event: SentryEvent, hint: Any?): SentryEvent {
33+
fields.asSequence()
34+
.filter(ReportField::show)
35+
.forEach { event.setExtra(it.name, it.value) }
36+
return event
37+
}
38+
})
3639
}
3740

3841
Sentry.configureScope { scope ->
@@ -116,7 +119,7 @@ public class SentryReporter private constructor(
116119
}
117120

118121
/**
119-
* Build configured [SentryReporter].
122+
* Builds configured [SentryReporter].
120123
*/
121124
override fun build(): Reporter {
122125
require(dsn.isNotBlank()) {

sentry-bukkit/src/main/kotlin/SentryBukkitIntegration.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
package ru.endlesscode.inspector.sentry.bukkit
22

3-
import io.sentry.IHub
4-
import io.sentry.Integration
5-
import io.sentry.SentryOptions
3+
import io.sentry.*
64
import org.bukkit.Server
75
import org.bukkit.plugin.Plugin
86

97
/**
10-
* SentryClientFactory that handles Bukkit-specific construction, like logging
8+
* [Integration] that handles Bukkit-specific info, like logging
119
* server and plugin information.
1210
*/
1311
public class SentryBukkitIntegration(private val plugin: Plugin) : Integration {
1412

1513
public companion object {
14+
1615
private val KNOWN_SERVERS = listOf("Paper", "Spigot", "CraftBukkit", "BungeeCord", "WaterFall")
1716
}
1817

@@ -25,10 +24,11 @@ public class SentryBukkitIntegration(private val plugin: Plugin) : Integration {
2524
options.sdkVersion?.addIntegration("bukkit")
2625
options.serverName = plugin.server.knownName
2726
options.setTag("minecraft", plugin.server.minecraftVersion)
28-
options.addEventProcessor { event, _ ->
29-
event.contexts.putAll(getContexts())
30-
event
31-
}
27+
options.addEventProcessor(object : EventProcessor {
28+
override fun process(event: SentryEvent, hint: Any?): SentryEvent {
29+
return event.also { it.contexts.putAll(getContexts()) }
30+
}
31+
})
3232
}
3333

3434
private fun getContexts(): Map<String, Map<String, Any>> {

0 commit comments

Comments
 (0)