Skip to content

Commit

Permalink
Merge pull request #80 from WebFiori/dev
Browse files Browse the repository at this point in the history
[Fix] Fix When Exception is not A Database Exception
  • Loading branch information
usernane authored Oct 30, 2023
2 parents 53f3107 + 6cf9886 commit 5a57f2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webfiori/database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public function transaction(callable $transaction, array $transactionArgs = [])
}
} catch (Exception $ex) {
$conn->rollBack($name);
throw new DatabaseException($ex->getMessage(), $ex->getCode(), $ex->getSQLQuery(), $ex);
$query = $ex instanceof DatabaseException ? $ex->getSQLQuery() : '';
throw new DatabaseException($ex->getMessage(), $ex->getCode(), $query, $ex);
}
}
/**
Expand Down

0 comments on commit 5a57f2d

Please sign in to comment.