summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-04-23 15:53:39 +0200
committerUrban Müller2018-04-23 15:53:39 +0200
commite2eb0132003c790b9c97bc58144a445dc8b376eb (patch)
tree09e0d627f8e809326c3076bec33811db62ea0878
parent930db3b36d87cd084e918f5cce6bc8f5760663ca (diff)
downloaditools-e2eb0132003c790b9c97bc58144a445dc8b376eb.tar.gz
itools-e2eb0132003c790b9c97bc58144a445dc8b376eb.tar.bz2
itools-e2eb0132003c790b9c97bc58144a445dc8b376eb.zip
catch cdist errs, shorter inline errs on devel
-rw-r--r--it.class6
1 files changed, 3 insertions, 3 deletions
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;
}