From e2eb0132003c790b9c97bc58144a445dc8b376eb Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 23 Apr 2018 15:53:39 +0200 Subject: catch cdist errs, shorter inline errs on devel --- it.class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'it.class') diff --git a/it.class b/it.class index 07822a6..4c8c0f1 100644 --- a/it.class +++ b/it.class @@ -249,8 +249,8 @@ static function error($p = array()) $body = ($p['omitdebuginfo'] >= 2 ? "" : ($url && !$toscreen? "{$p['title']}\n\nUrl: $url\n\n" : "") . ($trace ? ($sendmail ? "" : " ") . "Trace: $trace\n\n" : "")) . - ($p['omitdebuginfo'] >= 2 ? "" : "Host: " . getenv('HOSTNAME') . "\n\n") . - ($p['omitdebuginfo'] >= 2 ? "" : "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (started {$t}s before)" : "") . "\n\n") . # no it::date() due to time- debug param + (!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Host: " . getenv('HOSTNAME') . "\n\n") . + (!$sendmail || $p['omitdebuginfo'] >= 2 ? "" : "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (started {$t}s before)" : "") . "\n\n") . # no it::date() due to time- debug param ($p['body'] ? ($p['omitdebuginfo'] ? "" : "Body:\n") . trim($p['body'])."\n\n" : ""); if ($sendmail) # we're mailing: send maximum info @@ -714,7 +714,7 @@ static function cdist(/* $file1, ... */) foreach (func_get_args() as $arg) $files = array_merge((array)$files, (array)$arg); - return it::exec('cdist {FILES}' . (error_reporting() ? "" : " 2>/dev/null"), array('FILES' => $files)); + return ($errs = it::exec('cdist -q {FILES} 2>&1', ['FILES' => $files])) ? it::error(['title' => $errs]) : true; } -- cgit v1.2.3