Skip to content

Commit d8c8a36

Browse files
committed
grpc-pb: Address PR Comments
Signed-off-by: Johannes Zottele <[email protected]>
1 parent 73e2296 commit d8c8a36

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/pb/ProtobufException.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed class ProtobufException : RuntimeException {
1010

1111

1212
public class ProtobufDecodingException : ProtobufException {
13-
internal constructor(message: String, cause: Throwable? = null) : super(message, cause)
13+
public constructor(message: String, cause: Throwable? = null) : super(message, cause)
1414

1515
public companion object Companion {
1616
internal fun missingRequiredField(messageName: String, fieldName: String) =
@@ -36,5 +36,5 @@ public class ProtobufDecodingException : ProtobufException {
3636
}
3737

3838
public class ProtobufEncodingException : ProtobufException {
39-
internal constructor(message: String, cause: Throwable? = null) : super(message, cause)
39+
public constructor(message: String, cause: Throwable? = null) : super(message, cause)
4040
}

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/pb/WireDecoder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public interface WireDecoder : AutoCloseable {
105105
* Turns exceptions thrown by different platforms during decoding into [ProtobufDecodingException].
106106
*/
107107
@InternalRpcApi
108-
public expect fun checkForPlatformDecodeException(block: () -> Unit)
108+
public expect inline fun checkForPlatformDecodeException(block: () -> Unit)
109109

110110
/**
111111
* Creates a platform-specific [WireDecoder].

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/pb/WireEncoder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public interface WireEncoder {
6666
* Turns exceptions thrown by different platforms during encoding into [ProtobufEncodingException].
6767
*/
6868
@InternalRpcApi
69-
public expect fun checkForPlatformEncodeException(block: () -> Unit)
69+
public expect inline fun checkForPlatformEncodeException(block: () -> Unit)
7070

7171
@InternalRpcApi
7272
public expect fun WireEncoder(sink: Sink): WireEncoder

grpc/grpc-core/src/jvmMain/kotlin/kotlinx/rpc/grpc/pb/WireDecoder.jvm.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ internal class WireDecoderJvm(source: Buffer) : WireDecoder {
114114
}
115115

116116

117-
public actual fun checkForPlatformDecodeException(block: () -> Unit) {
117+
public actual inline fun checkForPlatformDecodeException(block: () -> Unit) {
118118
try {
119119
return block()
120120
} catch (e: InvalidProtocolBufferException) {

grpc/grpc-core/src/jvmMain/kotlin/kotlinx/rpc/grpc/pb/WireEncoder.jvm.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public actual fun WireEncoder(sink: Sink): WireEncoder {
201201
return WireEncoderJvm(sink)
202202
}
203203

204-
public actual fun checkForPlatformEncodeException(block: () -> Unit) {
204+
public actual inline fun checkForPlatformEncodeException(block: () -> Unit) {
205205
try {
206206
return block()
207207
} catch (e: IOException) {

grpc/grpc-core/src/nativeMain/kotlin/kotlinx/rpc/grpc/pb/WireDecoder.native.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,6 @@ internal class WireDecoderNative(private val source: Buffer) : WireDecoder {
302302

303303
public actual fun WireDecoder(source: Buffer): WireDecoder = WireDecoderNative(source)
304304

305-
public actual fun checkForPlatformDecodeException(block: () -> Unit) {
305+
public actual inline fun checkForPlatformDecodeException(block: () -> Unit) {
306306
block()
307307
}

grpc/grpc-core/src/nativeMain/kotlin/kotlinx/rpc/grpc/pb/WireEncoder.native.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,6 @@ private inline fun checked(crossinline block: () -> Boolean) {
209209
}
210210
}
211211

212-
public actual fun checkForPlatformEncodeException(block: () -> Unit) {
212+
public actual inline fun checkForPlatformEncodeException(block: () -> Unit) {
213213
block() // nothing to check for on native
214214
}

0 commit comments

Comments
 (0)