Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
Fix ODBCException
Browse files Browse the repository at this point in the history
  • Loading branch information
komex committed May 19, 2017
1 parent 3a267f3 commit bd57afc
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/Che/DBAL/Vertica/ODBCException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace Che\DBAL\Vertica;

use Exception;

/**
* Base exception class for ODBC errors
*
Expand All @@ -19,25 +17,13 @@
*/
class ODBCException extends \RuntimeException
{
/**
* ODBCException constructor.
*
* @param string $message
* @param int $code
* @param Exception $previous
*/
public function __construct($message = "", $code = 0, Exception $previous = null)
{
parent::__construct(sprintf('[%s] %s', $code, $message), $code, $previous);
}

/**
* @param resource $dbh
*
* @return ODBCException
*/
public static function fromConnection($dbh)
{
return new self(odbc_errormsg($dbh), odbc_error($dbh));
return new self(sprintf('[%s] %s', odbc_errormsg($dbh), odbc_error($dbh)));
}
}

0 comments on commit bd57afc

Please sign in to comment.