mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-05-18 14:33:34 +02:00
Proposal for better Exceptions
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Class written by xPaw
|
||||
*
|
||||
* Website: http://xpaw.me
|
||||
* GitHub: https://github.com/xPaw/PHP-Source-Query-Class
|
||||
*/
|
||||
|
||||
namespace xPaw\SourceQuery\Exception;
|
||||
|
||||
abstract class SourceQueryException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class InvalidArgumentException extends SourceQueryException
|
||||
{
|
||||
const TIMEOUT_NOT_INTEGER = 1;
|
||||
}
|
||||
|
||||
class TimeoutException extends SourceQueryException
|
||||
{
|
||||
const TIMEOUT_CONNECT = 1;
|
||||
}
|
||||
|
||||
class InvalidPacketException extends SourceQueryException
|
||||
{
|
||||
const PACKET_HEADER_MISMATCH = 1;
|
||||
const BUFFER_NOT_EMPTY = 2;
|
||||
|
||||
const CHECKSUM_MISMATCH = 3;
|
||||
}
|
||||
|
||||
class AuthenticationException extends SourceQueryException
|
||||
{
|
||||
const BAD_PASSWORD = 1;
|
||||
const BANNED = 2;
|
||||
}
|
||||
|
||||
class SocketException extends SourceQueryException
|
||||
{
|
||||
const COULD_NOT_CREATE_SOCKET = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user