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

resolve #58 return error response #72

Merged
merged 9 commits into from
Jun 24, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ data class TriggerRunResult(
val actionResults: MutableMap<String, ActionRunResult> = mutableMapOf()
) : ToXContent {
override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder {
var msg = error?.message;
seraphjiang marked this conversation as resolved.
Show resolved Hide resolved
if(error is ScriptException){
seraphjiang marked this conversation as resolved.
Show resolved Hide resolved
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