HOError.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Exceptions;
  3. use App\Exceptions\Repositories\HOException as HOException;
  4. class HOError
  5. {
  6. public function generalErr()
  7. {
  8. throw new HOException('General Error Occurred', 1001);
  9. }
  10. public function fail($msg = '失败')
  11. {
  12. throw new HOException($msg, 1002);
  13. }
  14. public function dataDoesNotExist()
  15. {
  16. throw new HOException('数据不存在', 1003);
  17. }
  18. public function dataDoesExist($msg = '数据已存在')
  19. {
  20. throw new HOException($msg, 1004);
  21. }
  22. public function authenticationFailed()
  23. {
  24. throw new HOException('API认证失败', 1005);
  25. }
  26. public function tokenDoesNotExist()
  27. {
  28. throw new HOException('登陆验证失败,重新登陆', 1006);
  29. }
  30. public function userDoesNotExist()
  31. {
  32. throw new HOException('用户不存在', 1007);
  33. }
  34. public function wrongPassword()
  35. {
  36. throw new HOException('密码错误', 1008);
  37. }
  38. public function wrongPayPassword()
  39. {
  40. throw new HOException('支付密码错误', 1009);
  41. }
  42. public function notImageFile()
  43. {
  44. throw new HOException('文件不是图片', 1010);
  45. }
  46. public function uploadImageFalse()
  47. {
  48. throw new HOException('图片上传失败', 1011);
  49. }
  50. }