From 0f21e4067b1664e055b91884198a23a3a803c2d5 Mon Sep 17 00:00:00 2001 From: Nikola Knezevic Date: Wed, 20 May 2020 15:49:07 +0200 Subject: [PATCH] Render the jobset page correctly when there are fetch errors The original code would return standard "Please come back later" page when there are only fetch errors on a newly setup declarative project. The problem is that there are two types of errors: standard errors and fetch errors. Each is acompanied by a corresponding field for time of occurence. Standard errors use 'errortime', while fetch errors have 'lastchecktime' set to the time of the error. Unfortunately, jobset.tt file was only using 'errortime' for displaying the time. This would result in the following errors in logs: Couldn't render template "date error - bad time/date string: expects 'h:m:s d:m:y' got: '' This change includes using 'lastchecktime' when rendering the error times. --- src/root/jobset.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/root/jobset.tt b/src/root/jobset.tt index b53a9af2..b775ddbd 100644 --- a/src/root/jobset.tt +++ b/src/root/jobset.tt @@ -119,7 +119,7 @@ [% IF jobset.errormsg || jobset.fetcherrormsg %]
-

Errors occurred at [% INCLUDE renderDateTime timestamp=jobset.errortime %].

+

Errors occurred at [% INCLUDE renderDateTime timestamp=(jobset.errortime || jobset.lastcheckedtime) %].

[% HTML.escape(jobset.fetcherrormsg || jobset.errormsg) %]
[% END %]