Skip to content

[pigeon] Kotlin generation got exception when using the generate sync host api #113187

@5peak2me

Description

@5peak2me
if (api != null) {
  channel.setMessageHandler { _, reply ->
    val wrapped = hashMapOf<String, Any?>()
    try {
      wrapped["result"] = api.getPlatformVersion()
    } catch (exception: Error) {
      wrapped["error"] = wrapError(exception)

    reply.reply(wrapped)
  }
}} else {
  channel.setMessageHandler(null)
}

the code above only reply when the exception hanpped. it should be

if (api != null) {
  channel.setMessageHandler { _, reply ->
    val wrapped = hashMapOf<String, Any?>()
    try {
      wrapped["result"] = api.getPlatformVersion()
    } catch (exception: Error) {
      wrapped["error"] = wrapError(exception)
    }
    reply.reply(wrapped)
  }
} else {
  channel.setMessageHandler(null)
}

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowfound in release: 3.3Found to occur in 3.3found in release: 3.5Found to occur in 3.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions