error.inc.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. class SysError extends Exception
  3. {
  4. public function __construct($message, $code = 0, Exception $previous = null) {
  5. parent::__construct($message, $code, $previous);
  6. }
  7. public function __toString() {
  8. return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
  9. }
  10. }
  11. class ParameterError extends Exception
  12. {
  13. public function __construct($message, $code = 0, Exception $previous = null) {
  14. parent::__construct($message, $code, $previous);
  15. }
  16. public function __toString() {
  17. return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
  18. }
  19. }
  20. class NetWorkError extends Exception
  21. {
  22. public function __construct($message, $code = 0, Exception $previous = null) {
  23. parent::__construct($message, $code, $previous);
  24. }
  25. public function __toString() {
  26. return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
  27. }
  28. }
  29. class HttpError extends Exception
  30. {
  31. public function __construct($message, $code = 0, Exception $previous = null) {
  32. parent::__construct($message, $code, $previous);
  33. }
  34. public function __toString() {
  35. return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
  36. }
  37. }
  38. class QyApiError extends Exception
  39. {
  40. public function __construct($message, $code = 0, Exception $previous = null) {
  41. parent::__construct($message, $code, $previous);
  42. }
  43. public function __toString() {
  44. return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
  45. }
  46. }