CORDA-1342 - The shell doesn't print the return value of a started flow - fixed. (#3007) (#3197)

This commit is contained in:
Katelyn Baker 2018-05-19 12:35:12 +01:00 committed by GitHub
parent 540132174c
commit 2d1ceb6cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,11 +270,18 @@ object InteractiveShell {
} catch (e: InterruptedException) {
// TODO: When the flow framework allows us to kill flows mid-flight, do so here.
}
stateObservable.returnValue.get()?.apply {
if (this !is Throwable) {
output.println("Flow completed with result: $this")
}
}
} catch (e: NoApplicableConstructor) {
output.println("No matching constructor found:", Color.red)
e.errors.forEach { output.println("- $it", Color.red) }
} catch (e: PermissionException) {
output.println(e.message ?: "Access denied", Color.red)
} catch (e: ExecutionException) {
// ignoring it as already logged by the progress handler subscriber
} finally {
InputStreamDeserializer.closeAll()
}