1
0
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:
Michael Yoo
2015-02-01 15:13:12 +10:30
parent 6d3355f01f
commit cfcd43111c
6 changed files with 94 additions and 40 deletions
+43
View File
@@ -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;
}