From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST 2/4] ms-queuedaemon: Break out catching-internally Date: Thu, 17 Sep 2015 17:14:53 +0100 Message-ID: <1442506495-10239-2-git-send-email-ian.campbell@citrix.com> References: <1442506474.18856.227.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442506474.18856.227.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org From: Ian Jackson No functional change. Signed-off-by: Ian Jackson --- ms-queuedaemon | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ms-queuedaemon b/ms-queuedaemon index 1a31284..f3f85bd 100755 --- a/ms-queuedaemon +++ b/ms-queuedaemon @@ -39,6 +39,16 @@ proc foreach-walker {walkervar body} { } } +proc catching-internally {what try {ifok {}}} { + if {[catch { + uplevel 1 $try + } emsg]} { + log "INTERNAL ERROR $what: $emsg" + } else { + uplevel 1 $ifok + } +} + proc chan-destroy-stuff {chan} { dequeue-chan $chan destroy upvar #0 chan-info/$chan info @@ -288,12 +298,10 @@ proc queuerun-perhaps-step {w} { proc report-plan {w wo} { global c - if {[catch { + catching-internally "showing $w html" { set outputfile "$c(WebspaceFile)/resource-$wo.html" exec ./ms-planner -w$w show-html > $outputfile - } emsg]} { - log "INTERNAL ERROR showing $w html: $emsg" - } else { + } { set out data-$wo.final.pl file copy -force data-$w.pl $out.new file rename -force $out.new $out @@ -486,10 +494,8 @@ proc restarter-restart-now {} { log-event "restarter-restart-now projection-running" } - if {[catch { + catching-internally "setting unprocessed" { chans-note-unprocessed plan [set plan/queue_running] - } emsg]} { - log "INTERNAL ERROR setting unprocessed: $emsg" } report-plan plan plan -- 2.5.1