Skip to content

Commit

Permalink
exception: use natural explanatory style
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 16, 2025
1 parent 7ea0634 commit b1e5349
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/Dibi/exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


/**
* Dibi common exception.
* A database operation failed.
*/
class Exception extends \Exception
{
Expand Down Expand Up @@ -44,15 +44,15 @@ public function __toString(): string


/**
* database server exception.
* The database server reported an error.
*/
class DriverException extends Exception
{
}


/**
* PCRE exception.
* Regular expression pattern or execution failed.
*/
class PcreException extends Exception
{
Expand All @@ -63,18 +63,24 @@ public function __construct()
}


/**
* The requested feature is not implemented.
*/
class NotImplementedException extends Exception
{
}


/**
* The requested operation is not supported.
*/
class NotSupportedException extends Exception
{
}


/**
* Database procedure exception.
* A database stored procedure failed.
*/
class ProcedureException extends Exception
{
Expand Down Expand Up @@ -102,31 +108,31 @@ public function getSeverity(): string


/**
* Base class for all constraint violation related exceptions.
* A database constraint was violated.
*/
class ConstraintViolationException extends DriverException
{
}


/**
* Exception for a foreign key constraint violation.
* The foreign key constraint check failed.
*/
class ForeignKeyConstraintViolationException extends ConstraintViolationException
{
}


/**
* Exception for a NOT NULL constraint violation.
* The NOT NULL constraint check failed.
*/
class NotNullConstraintViolationException extends ConstraintViolationException
{
}


/**
* Exception for a unique constraint violation.
* The unique constraint check failed.
*/
class UniqueConstraintViolationException extends ConstraintViolationException
{
Expand Down

0 comments on commit b1e5349

Please sign in to comment.