变更
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ class BackupCommand extends Command
|
||||
|
||||
$output->write('dump data success');
|
||||
} catch (\Throwable $throwable) {
|
||||
$output->writeln($throwable->getMessage());
|
||||
$output->writeln(throwable($throwable));
|
||||
} finally {
|
||||
return 1;
|
||||
}
|
||||
|
||||
+2
-1
@@ -211,7 +211,8 @@ class Command extends Component
|
||||
private function error(Throwable $throwable): bool
|
||||
{
|
||||
$message = $this->sql . '.' . json_encode($this->params, JSON_UNESCAPED_UNICODE);
|
||||
return \Kiri::getLogger()->addError($message . $throwable->getMessage(), 'mysql');
|
||||
error($throwable, [$message]);
|
||||
return addError($throwable->getMessage(), 'mysql');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ class Db implements ISqlBuilder
|
||||
try {
|
||||
$result = call_user_func($closure, ...$params);
|
||||
} catch (\Throwable $throwable) {
|
||||
$result = logger()->addError($throwable->getMessage(), 'mysql');
|
||||
error($throwable);
|
||||
$result = addError($throwable->getMessage(), 'mysql');
|
||||
} finally {
|
||||
if ($result === false) {
|
||||
static::rollback();
|
||||
|
||||
@@ -185,7 +185,7 @@ class Model extends Base\Model
|
||||
public static function inserts(array $data): bool
|
||||
{
|
||||
if (empty($data)) {
|
||||
return error('Insert data empty.', 'mysql');
|
||||
return addError('Insert data empty.', 'mysql');
|
||||
}
|
||||
return static::query()->insert($data);
|
||||
}
|
||||
|
||||
+2
-2
@@ -149,7 +149,7 @@ class Pagination extends Component
|
||||
try {
|
||||
call_user_func($this->_callback, $data, $param);
|
||||
} catch (\Throwable $exception) {
|
||||
\Kiri::getLogger()->addError($exception, 'throwable');
|
||||
error($exception);
|
||||
} finally {
|
||||
$data = null;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ class Pagination extends Component
|
||||
try {
|
||||
call_user_func($this->_callback, $data, $param);
|
||||
} catch (\Throwable $exception) {
|
||||
\Kiri::getLogger()->addError($exception, 'throwable');
|
||||
error($exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user