From c8983ca07602eaa21d640c5b473f699f59ed97d7 Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Tue, 20 Aug 2019 11:07:43 +0200 Subject: [PATCH] Add `haserrormsg` boolean attribute to jobset API response This attribute allows to know if an error occurred or not: when an error occurs, errormsg is not an empty string. Note we can not use the errormsg attribute because it can be arbitrarily long and is excluded from the jobset API response. --- src/lib/Hydra/Controller/API.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/API.pm b/src/lib/Hydra/Controller/API.pm index 1840d1e9..8bb710e0 100644 --- a/src/lib/Hydra/Controller/API.pm +++ b/src/lib/Hydra/Controller/API.pm @@ -87,7 +87,8 @@ sub jobsetToHash { checkinterval => $jobset->checkinterval, triggertime => $jobset->triggertime, fetcherrormsg => $jobset->fetcherrormsg, - errortime => $jobset->errortime + errortime => $jobset->errortime, + haserrormsg => $jobset->errormsg eq "" ? JSON::false : JSON::true }; }