Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
resolve #58 return error response (#72)
Browse files Browse the repository at this point in the history
* resolve #58 return error response
this is required api change to support quick fix for #58, there is another long term error exception handle enhancement in plan.

* fix code formation issue to pass style check
  • Loading branch information
seraphjiang authored Jun 24, 2019
1 parent 5ef6221 commit 9c66731
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ data class TriggerRunResult(
val actionResults: MutableMap<String, ActionRunResult> = mutableMapOf()
) : ToXContent {
override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder {
var msg = error?.message
if (error is ScriptException) msg = error.toJsonString()
return builder.startObject()
.field("name", triggerName)
.field("triggered", triggered)
.field("error", error?.message)
.field("error", msg)
.field("action_results", actionResults as Map<String, ActionRunResult>)
.endObject()
}
Expand Down

0 comments on commit 9c66731

Please sign in to comment.