Skip to content

Commit 7091fd4

Browse files
committed
fix: cast $e to string
1 parent 8754dec commit 7091fd4

8 files changed

Lines changed: 8 additions & 8 deletions

File tree

system/CLI/CLI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public static function generateDimensions()
673673
// Then let the developer know of the error.
674674
static::$height = null;
675675
static::$width = null;
676-
log_message('error', $e);
676+
log_message('error', (string) $e);
677677
}
678678
}
679679

system/CLI/GeneratorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected function renderTemplate(array $data = []): string
234234
try {
235235
return view(config('Generators')->views[$this->name], $data, ['debug' => false]);
236236
} catch (Throwable $e) {
237-
log_message('error', $e);
237+
log_message('error', (string) $e);
238238

239239
return view("CodeIgniter\\Commands\\Generators\\Views\\{$this->template}", $data, ['debug' => false]);
240240
}

system/Cookie/CookieStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function fromCookieHeaders(array $headers, bool $raw = false)
4949
try {
5050
return Cookie::fromHeaderString($header, $raw);
5151
} catch (CookieException $e) {
52-
log_message('error', $e);
52+
log_message('error', (string) $e);
5353

5454
return false;
5555
}

system/Database/MySQLi/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ protected function execute(string $sql)
291291
try {
292292
return $this->connID->query($this->prepQuery($sql), $this->resultMode);
293293
} catch (mysqli_sql_exception $e) {
294-
log_message('error', $e);
294+
log_message('error', (string) $e);
295295

296296
if ($this->DBDebug) {
297297
throw $e;

system/Database/OCI8/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected function execute(string $sql)
204204

205205
return $result;
206206
} catch (ErrorException $e) {
207-
log_message('error', $e);
207+
log_message('error', (string) $e);
208208

209209
if ($this->DBDebug) {
210210
throw $e;

system/Database/Postgre/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected function execute(string $sql)
134134
try {
135135
return pg_query($this->connID, $sql);
136136
} catch (ErrorException $e) {
137-
log_message('error', $e);
137+
log_message('error', (string) $e);
138138
if ($this->DBDebug) {
139139
throw $e;
140140
}

system/Database/SQLite3/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected function execute(string $sql)
129129
? $this->connID->exec($sql)
130130
: $this->connID->query($sql);
131131
} catch (ErrorException $e) {
132-
log_message('error', $e);
132+
log_message('error', (string) $e);
133133
if ($this->DBDebug) {
134134
throw $e;
135135
}

system/HTTP/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public function getCookie(?string $name = null, string $prefix = '')
634634

635635
return $this->cookieStore->get($name, $prefix);
636636
} catch (CookieException $e) {
637-
log_message('error', $e);
637+
log_message('error', (string) $e);
638638

639639
return null;
640640
}

0 commit comments

Comments
 (0)