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

This commit is contained in:
Michele Sollecito 2018-04-26 22:51:23 +07:00 committed by GitHub
parent b208d03f5c
commit 033fc3cf7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -275,11 +275,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()
}