diff options
author | Urban Müller | 2018-04-23 15:53:39 +0200 |
---|---|---|
committer | Urban Müller | 2018-04-23 15:53:39 +0200 |
commit | e2eb0132003c790b9c97bc58144a445dc8b376eb (patch) | |
tree | 09e0d627f8e809326c3076bec33811db62ea0878 | |
parent | 930db3b36d87cd084e918f5cce6bc8f5760663ca (diff) | |
download | itools-e2eb0132003c790b9c97bc58144a445dc8b376eb.tar.gz itools-e2eb0132003c790b9c97bc58144a445dc8b376eb.tar.bz2 itools-e2eb0132003c790b9c97bc58144a445dc8b376eb.zip |
catch cdist errs, shorter inline errs on devel
-rw-r--r-- | it.class | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |