Connection.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Bart Visscher <bartv@thisnet.nl>
  7. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Julius Härtl <jus@bitgrid.net>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Ole Ostergaard <ole.c.ostergaard@gmail.com>
  12. * @author Ole Ostergaard <ole.ostergaard@knime.com>
  13. * @author Philipp Schaffrath <github@philipp.schaffrath.email>
  14. * @author Robin Appelman <robin@icewind.nl>
  15. * @author Robin McCorkell <robin@mccorkell.me.uk>
  16. * @author Roeland Jago Douma <roeland@famdouma.nl>
  17. * @author Thomas Müller <thomas.mueller@tmit.eu>
  18. *
  19. * @license AGPL-3.0
  20. *
  21. * This code is free software: you can redistribute it and/or modify
  22. * it under the terms of the GNU Affero General Public License, version 3,
  23. * as published by the Free Software Foundation.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU Affero General Public License for more details.
  29. *
  30. * You should have received a copy of the GNU Affero General Public License, version 3,
  31. * along with this program. If not, see <http://www.gnu.org/licenses/>
  32. *
  33. */
  34. namespace OC\DB;
  35. use Doctrine\Common\EventManager;
  36. use Doctrine\DBAL\Cache\QueryCacheProfile;
  37. use Doctrine\DBAL\Configuration;
  38. use Doctrine\DBAL\Driver;
  39. use Doctrine\DBAL\Exception;
  40. use Doctrine\DBAL\Platforms\MySQLPlatform;
  41. use Doctrine\DBAL\Platforms\OraclePlatform;
  42. use Doctrine\DBAL\Platforms\SqlitePlatform;
  43. use Doctrine\DBAL\Result;
  44. use Doctrine\DBAL\Schema\Schema;
  45. use Doctrine\DBAL\Statement;
  46. use OC\DB\QueryBuilder\QueryBuilder;
  47. use OC\SystemConfig;
  48. use OCP\DB\QueryBuilder\IQueryBuilder;
  49. use OCP\Diagnostics\IEventLogger;
  50. use OCP\IRequestId;
  51. use OCP\PreConditionNotMetException;
  52. use OCP\Profiler\IProfiler;
  53. use OCP\Server;
  54. use Psr\Log\LoggerInterface;
  55. class Connection extends \Doctrine\DBAL\Connection {
  56. /** @var string */
  57. protected $tablePrefix;
  58. /** @var \OC\DB\Adapter $adapter */
  59. protected $adapter;
  60. /** @var SystemConfig */
  61. private $systemConfig;
  62. private LoggerInterface $logger;
  63. protected $lockedTable = null;
  64. /** @var int */
  65. protected $queriesBuilt = 0;
  66. /** @var int */
  67. protected $queriesExecuted = 0;
  68. /** @var DbDataCollector|null */
  69. protected $dbDataCollector = null;
  70. protected bool $logDbException = false;
  71. private ?array $transactionBacktrace = null;
  72. protected bool $logRequestId;
  73. protected string $requestId;
  74. /**
  75. * Initializes a new instance of the Connection class.
  76. *
  77. * @throws \Exception
  78. */
  79. public function __construct(
  80. array $params,
  81. Driver $driver,
  82. ?Configuration $config = null,
  83. ?EventManager $eventManager = null
  84. ) {
  85. if (!isset($params['adapter'])) {
  86. throw new \Exception('adapter not set');
  87. }
  88. if (!isset($params['tablePrefix'])) {
  89. throw new \Exception('tablePrefix not set');
  90. }
  91. /**
  92. * @psalm-suppress InternalMethod
  93. */
  94. parent::__construct($params, $driver, $config, $eventManager);
  95. $this->adapter = new $params['adapter']($this);
  96. $this->tablePrefix = $params['tablePrefix'];
  97. $this->systemConfig = \OC::$server->getSystemConfig();
  98. $this->logger = \OC::$server->get(LoggerInterface::class);
  99. $this->logRequestId = $this->systemConfig->getValue('db.log_request_id', false);
  100. $this->logDbException = $this->systemConfig->getValue('db.log_exceptions', false);
  101. $this->requestId = Server::get(IRequestId::class)->getId();
  102. /** @var \OCP\Profiler\IProfiler */
  103. $profiler = \OC::$server->get(IProfiler::class);
  104. if ($profiler->isEnabled()) {
  105. $this->dbDataCollector = new DbDataCollector($this);
  106. $profiler->add($this->dbDataCollector);
  107. $debugStack = new BacktraceDebugStack();
  108. $this->dbDataCollector->setDebugStack($debugStack);
  109. $this->_config->setSQLLogger($debugStack);
  110. }
  111. }
  112. /**
  113. * @throws Exception
  114. */
  115. public function connect() {
  116. try {
  117. if ($this->_conn) {
  118. /** @psalm-suppress InternalMethod */
  119. return parent::connect();
  120. }
  121. // Only trigger the event logger for the initial connect call
  122. $eventLogger = \OC::$server->get(IEventLogger::class);
  123. $eventLogger->start('connect:db', 'db connection opened');
  124. /** @psalm-suppress InternalMethod */
  125. $status = parent::connect();
  126. $eventLogger->end('connect:db');
  127. return $status;
  128. } catch (Exception $e) {
  129. // throw a new exception to prevent leaking info from the stacktrace
  130. throw new Exception('Failed to connect to the database: ' . $e->getMessage(), $e->getCode());
  131. }
  132. }
  133. public function getStats(): array {
  134. return [
  135. 'built' => $this->queriesBuilt,
  136. 'executed' => $this->queriesExecuted,
  137. ];
  138. }
  139. /**
  140. * Returns a QueryBuilder for the connection.
  141. */
  142. public function getQueryBuilder(): IQueryBuilder {
  143. $this->queriesBuilt++;
  144. return new QueryBuilder(
  145. new ConnectionAdapter($this),
  146. $this->systemConfig,
  147. $this->logger
  148. );
  149. }
  150. /**
  151. * Gets the QueryBuilder for the connection.
  152. *
  153. * @return \Doctrine\DBAL\Query\QueryBuilder
  154. * @deprecated please use $this->getQueryBuilder() instead
  155. */
  156. public function createQueryBuilder() {
  157. $backtrace = $this->getCallerBacktrace();
  158. $this->logger->debug('Doctrine QueryBuilder retrieved in {backtrace}', ['app' => 'core', 'backtrace' => $backtrace]);
  159. $this->queriesBuilt++;
  160. return parent::createQueryBuilder();
  161. }
  162. /**
  163. * Gets the ExpressionBuilder for the connection.
  164. *
  165. * @return \Doctrine\DBAL\Query\Expression\ExpressionBuilder
  166. * @deprecated please use $this->getQueryBuilder()->expr() instead
  167. */
  168. public function getExpressionBuilder() {
  169. $backtrace = $this->getCallerBacktrace();
  170. $this->logger->debug('Doctrine ExpressionBuilder retrieved in {backtrace}', ['app' => 'core', 'backtrace' => $backtrace]);
  171. $this->queriesBuilt++;
  172. return parent::getExpressionBuilder();
  173. }
  174. /**
  175. * Get the file and line that called the method where `getCallerBacktrace()` was used
  176. *
  177. * @return string
  178. */
  179. protected function getCallerBacktrace() {
  180. $traces = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
  181. // 0 is the method where we use `getCallerBacktrace`
  182. // 1 is the target method which uses the method we want to log
  183. if (isset($traces[1])) {
  184. return $traces[1]['file'] . ':' . $traces[1]['line'];
  185. }
  186. return '';
  187. }
  188. /**
  189. * @return string
  190. */
  191. public function getPrefix() {
  192. return $this->tablePrefix;
  193. }
  194. /**
  195. * Prepares an SQL statement.
  196. *
  197. * @param string $statement The SQL statement to prepare.
  198. * @param int|null $limit
  199. * @param int|null $offset
  200. *
  201. * @return Statement The prepared statement.
  202. * @throws Exception
  203. */
  204. public function prepare($sql, $limit = null, $offset = null): Statement {
  205. if ($limit === -1 || $limit === null) {
  206. $limit = null;
  207. } else {
  208. $limit = (int) $limit;
  209. }
  210. if ($offset !== null) {
  211. $offset = (int) $offset;
  212. }
  213. if (!is_null($limit)) {
  214. $platform = $this->getDatabasePlatform();
  215. $sql = $platform->modifyLimitQuery($sql, $limit, $offset);
  216. }
  217. $statement = $this->finishQuery($sql);
  218. return parent::prepare($statement);
  219. }
  220. /**
  221. * Executes an, optionally parametrized, SQL query.
  222. *
  223. * If the query is parametrized, a prepared statement is used.
  224. * If an SQLLogger is configured, the execution is logged.
  225. *
  226. * @param string $sql The SQL query to execute.
  227. * @param array $params The parameters to bind to the query, if any.
  228. * @param array $types The types the previous parameters are in.
  229. * @param \Doctrine\DBAL\Cache\QueryCacheProfile|null $qcp The query cache profile, optional.
  230. *
  231. * @return Result The executed statement.
  232. *
  233. * @throws \Doctrine\DBAL\Exception
  234. */
  235. public function executeQuery(string $sql, array $params = [], $types = [], QueryCacheProfile $qcp = null): Result {
  236. $sql = $this->finishQuery($sql);
  237. $this->queriesExecuted++;
  238. $this->logQueryToFile($sql);
  239. try {
  240. return parent::executeQuery($sql, $params, $types, $qcp);
  241. } catch (\Exception $e) {
  242. $this->logDatabaseException($e);
  243. throw $e;
  244. }
  245. }
  246. /**
  247. * @throws Exception
  248. */
  249. public function executeUpdate(string $sql, array $params = [], array $types = []): int {
  250. $sql = $this->finishQuery($sql);
  251. $this->queriesExecuted++;
  252. $this->logQueryToFile($sql);
  253. return parent::executeUpdate($sql, $params, $types);
  254. }
  255. /**
  256. * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
  257. * and returns the number of affected rows.
  258. *
  259. * This method supports PDO binding types as well as DBAL mapping types.
  260. *
  261. * @param string $sql The SQL query.
  262. * @param array $params The query parameters.
  263. * @param array $types The parameter types.
  264. *
  265. * @return int The number of affected rows.
  266. *
  267. * @throws \Doctrine\DBAL\Exception
  268. */
  269. public function executeStatement($sql, array $params = [], array $types = []): int {
  270. $sql = $this->finishQuery($sql);
  271. $this->queriesExecuted++;
  272. $this->logQueryToFile($sql);
  273. try {
  274. return (int)parent::executeStatement($sql, $params, $types);
  275. } catch (\Exception $e) {
  276. $this->logDatabaseException($e);
  277. throw $e;
  278. }
  279. }
  280. protected function logQueryToFile(string $sql): void {
  281. $logFile = $this->systemConfig->getValue('query_log_file');
  282. if ($logFile !== '' && is_writable(dirname($logFile)) && (!file_exists($logFile) || is_writable($logFile))) {
  283. $prefix = '';
  284. if ($this->systemConfig->getValue('query_log_file_requestid') === 'yes') {
  285. $prefix .= \OC::$server->get(IRequestId::class)->getId() . "\t";
  286. }
  287. file_put_contents(
  288. $this->systemConfig->getValue('query_log_file', ''),
  289. $prefix . $sql . "\n",
  290. FILE_APPEND
  291. );
  292. }
  293. }
  294. /**
  295. * Returns the ID of the last inserted row, or the last value from a sequence object,
  296. * depending on the underlying driver.
  297. *
  298. * Note: This method may not return a meaningful or consistent result across different drivers,
  299. * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY
  300. * columns or sequences.
  301. *
  302. * @param string $seqName Name of the sequence object from which the ID should be returned.
  303. *
  304. * @return int the last inserted ID.
  305. * @throws Exception
  306. */
  307. public function lastInsertId($name = null): int {
  308. if ($name) {
  309. $name = $this->replaceTablePrefix($name);
  310. }
  311. return $this->adapter->lastInsertId($name);
  312. }
  313. /**
  314. * @internal
  315. * @throws Exception
  316. */
  317. public function realLastInsertId($seqName = null) {
  318. return parent::lastInsertId($seqName);
  319. }
  320. /**
  321. * Insert a row if the matching row does not exists. To accomplish proper race condition avoidance
  322. * it is needed that there is also a unique constraint on the values. Then this method will
  323. * catch the exception and return 0.
  324. *
  325. * @param string $table The table name (will replace *PREFIX* with the actual prefix)
  326. * @param array $input data that should be inserted into the table (column name => value)
  327. * @param array|null $compare List of values that should be checked for "if not exists"
  328. * If this is null or an empty array, all keys of $input will be compared
  329. * Please note: text fields (clob) must not be used in the compare array
  330. * @return int number of inserted rows
  331. * @throws \Doctrine\DBAL\Exception
  332. * @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
  333. */
  334. public function insertIfNotExist($table, $input, array $compare = null) {
  335. try {
  336. return $this->adapter->insertIfNotExist($table, $input, $compare);
  337. } catch (\Exception $e) {
  338. $this->logDatabaseException($e);
  339. throw $e;
  340. }
  341. }
  342. public function insertIgnoreConflict(string $table, array $values) : int {
  343. try {
  344. return $this->adapter->insertIgnoreConflict($table, $values);
  345. } catch (\Exception $e) {
  346. $this->logDatabaseException($e);
  347. throw $e;
  348. }
  349. }
  350. private function getType($value) {
  351. if (is_bool($value)) {
  352. return IQueryBuilder::PARAM_BOOL;
  353. } elseif (is_int($value)) {
  354. return IQueryBuilder::PARAM_INT;
  355. } else {
  356. return IQueryBuilder::PARAM_STR;
  357. }
  358. }
  359. /**
  360. * Insert or update a row value
  361. *
  362. * @param string $table
  363. * @param array $keys (column name => value)
  364. * @param array $values (column name => value)
  365. * @param array $updatePreconditionValues ensure values match preconditions (column name => value)
  366. * @return int number of new rows
  367. * @throws \OCP\DB\Exception
  368. * @throws PreConditionNotMetException
  369. */
  370. public function setValues(string $table, array $keys, array $values, array $updatePreconditionValues = []): int {
  371. try {
  372. $insertQb = $this->getQueryBuilder();
  373. $insertQb->insert($table)
  374. ->values(
  375. array_map(function ($value) use ($insertQb) {
  376. return $insertQb->createNamedParameter($value, $this->getType($value));
  377. }, array_merge($keys, $values))
  378. );
  379. return $insertQb->executeStatement();
  380. } catch (\OCP\DB\Exception $e) {
  381. if (!in_array($e->getReason(), [
  382. \OCP\DB\Exception::REASON_CONSTRAINT_VIOLATION,
  383. \OCP\DB\Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION,
  384. ])
  385. ) {
  386. throw $e;
  387. }
  388. // value already exists, try update
  389. $updateQb = $this->getQueryBuilder();
  390. $updateQb->update($table);
  391. foreach ($values as $name => $value) {
  392. $updateQb->set($name, $updateQb->createNamedParameter($value, $this->getType($value)));
  393. }
  394. $where = $updateQb->expr()->andX();
  395. $whereValues = array_merge($keys, $updatePreconditionValues);
  396. foreach ($whereValues as $name => $value) {
  397. if ($value === '') {
  398. $where->add($updateQb->expr()->emptyString(
  399. $name
  400. ));
  401. } else {
  402. $where->add($updateQb->expr()->eq(
  403. $name,
  404. $updateQb->createNamedParameter($value, $this->getType($value)),
  405. $this->getType($value)
  406. ));
  407. }
  408. }
  409. $updateQb->where($where);
  410. $affected = $updateQb->executeStatement();
  411. if ($affected === 0 && !empty($updatePreconditionValues)) {
  412. throw new PreConditionNotMetException();
  413. }
  414. return 0;
  415. }
  416. }
  417. /**
  418. * Create an exclusive read+write lock on a table
  419. *
  420. * @param string $tableName
  421. *
  422. * @throws \BadMethodCallException When trying to acquire a second lock
  423. * @throws Exception
  424. * @since 9.1.0
  425. */
  426. public function lockTable($tableName) {
  427. if ($this->lockedTable !== null) {
  428. throw new \BadMethodCallException('Can not lock a new table until the previous lock is released.');
  429. }
  430. $tableName = $this->tablePrefix . $tableName;
  431. $this->lockedTable = $tableName;
  432. $this->adapter->lockTable($tableName);
  433. }
  434. /**
  435. * Release a previous acquired lock again
  436. *
  437. * @throws Exception
  438. * @since 9.1.0
  439. */
  440. public function unlockTable() {
  441. $this->adapter->unlockTable();
  442. $this->lockedTable = null;
  443. }
  444. /**
  445. * returns the error code and message as a string for logging
  446. * works with DoctrineException
  447. * @return string
  448. */
  449. public function getError() {
  450. $msg = $this->errorCode() . ': ';
  451. $errorInfo = $this->errorInfo();
  452. if (!empty($errorInfo)) {
  453. $msg .= 'SQLSTATE = '.$errorInfo[0] . ', ';
  454. $msg .= 'Driver Code = '.$errorInfo[1] . ', ';
  455. $msg .= 'Driver Message = '.$errorInfo[2];
  456. }
  457. return $msg;
  458. }
  459. public function errorCode() {
  460. return -1;
  461. }
  462. public function errorInfo() {
  463. return [];
  464. }
  465. /**
  466. * Drop a table from the database if it exists
  467. *
  468. * @param string $table table name without the prefix
  469. *
  470. * @throws Exception
  471. */
  472. public function dropTable($table) {
  473. $table = $this->tablePrefix . trim($table);
  474. $schema = $this->getSchemaManager();
  475. if ($schema->tablesExist([$table])) {
  476. $schema->dropTable($table);
  477. }
  478. }
  479. /**
  480. * Check if a table exists
  481. *
  482. * @param string $table table name without the prefix
  483. *
  484. * @return bool
  485. * @throws Exception
  486. */
  487. public function tableExists($table) {
  488. $table = $this->tablePrefix . trim($table);
  489. $schema = $this->getSchemaManager();
  490. return $schema->tablesExist([$table]);
  491. }
  492. protected function finishQuery(string $statement): string {
  493. $statement = $this->replaceTablePrefix($statement);
  494. $statement = $this->adapter->fixupStatement($statement);
  495. if ($this->logRequestId) {
  496. return $statement . " /* reqid: " . $this->requestId . " */";
  497. } else {
  498. return $statement;
  499. }
  500. }
  501. // internal use
  502. /**
  503. * @param string $statement
  504. * @return string
  505. */
  506. protected function replaceTablePrefix($statement) {
  507. return str_replace('*PREFIX*', $this->tablePrefix, $statement);
  508. }
  509. /**
  510. * Check if a transaction is active
  511. *
  512. * @return bool
  513. * @since 8.2.0
  514. */
  515. public function inTransaction() {
  516. return $this->getTransactionNestingLevel() > 0;
  517. }
  518. /**
  519. * Escape a parameter to be used in a LIKE query
  520. *
  521. * @param string $param
  522. * @return string
  523. */
  524. public function escapeLikeParameter($param) {
  525. return addcslashes($param, '\\_%');
  526. }
  527. /**
  528. * Check whether or not the current database support 4byte wide unicode
  529. *
  530. * @return bool
  531. * @since 11.0.0
  532. */
  533. public function supports4ByteText() {
  534. if (!$this->getDatabasePlatform() instanceof MySQLPlatform) {
  535. return true;
  536. }
  537. return $this->getParams()['charset'] === 'utf8mb4';
  538. }
  539. /**
  540. * Create the schema of the connected database
  541. *
  542. * @return Schema
  543. * @throws Exception
  544. */
  545. public function createSchema() {
  546. $migrator = $this->getMigrator();
  547. return $migrator->createSchema();
  548. }
  549. /**
  550. * Migrate the database to the given schema
  551. *
  552. * @param Schema $toSchema
  553. * @param bool $dryRun If true, will return the sql queries instead of running them.
  554. *
  555. * @throws Exception
  556. *
  557. * @return string|null Returns a string only if $dryRun is true.
  558. */
  559. public function migrateToSchema(Schema $toSchema, bool $dryRun = false) {
  560. $migrator = $this->getMigrator();
  561. if ($dryRun) {
  562. return $migrator->generateChangeScript($toSchema);
  563. } else {
  564. $migrator->migrate($toSchema);
  565. }
  566. }
  567. private function getMigrator() {
  568. // TODO properly inject those dependencies
  569. $random = \OC::$server->getSecureRandom();
  570. $platform = $this->getDatabasePlatform();
  571. $config = \OC::$server->getConfig();
  572. $dispatcher = \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class);
  573. if ($platform instanceof SqlitePlatform) {
  574. return new SQLiteMigrator($this, $config, $dispatcher);
  575. } elseif ($platform instanceof OraclePlatform) {
  576. return new OracleMigrator($this, $config, $dispatcher);
  577. } else {
  578. return new Migrator($this, $config, $dispatcher);
  579. }
  580. }
  581. public function beginTransaction() {
  582. if (!$this->inTransaction()) {
  583. $this->transactionBacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
  584. }
  585. return parent::beginTransaction();
  586. }
  587. public function commit() {
  588. $result = parent::commit();
  589. if ($this->getTransactionNestingLevel() === 0) {
  590. $this->transactionBacktrace = null;
  591. }
  592. return $result;
  593. }
  594. public function rollBack() {
  595. $result = parent::rollBack();
  596. if ($this->getTransactionNestingLevel() === 0) {
  597. $this->transactionBacktrace = null;
  598. }
  599. return $result;
  600. }
  601. /**
  602. * Log a database exception if enabled
  603. *
  604. * @param \Exception $exception
  605. * @return void
  606. */
  607. public function logDatabaseException(\Exception $exception): void {
  608. if ($this->logDbException) {
  609. if ($exception instanceof Exception\UniqueConstraintViolationException) {
  610. $this->logger->info($exception->getMessage(), ['exception' => $exception, 'transaction' => $this->transactionBacktrace]);
  611. } else {
  612. $this->logger->error($exception->getMessage(), ['exception' => $exception, 'transaction' => $this->transactionBacktrace]);
  613. }
  614. }
  615. }
  616. }