EMError.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*!
  2. * \~chinese
  3. * @header EMError.h
  4. * @abstract SDK定义的错误
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMError.h
  10. * @abstract SDK defined error
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMErrorCode.h"
  16. /*!
  17. * \~chinese
  18. * SDK定义的错误
  19. *
  20. * \~english
  21. * SDK defined error
  22. */
  23. @interface EMError : NSObject
  24. /*!
  25. * \~chinese
  26. * 错误码
  27. *
  28. * \~english
  29. * Error code
  30. */
  31. @property (nonatomic) EMErrorCode code;
  32. /*!
  33. * \~chinese
  34. * 错误描述
  35. *
  36. * \~english
  37. * Error description
  38. */
  39. @property (nonatomic, copy) NSString *errorDescription;
  40. #pragma mark - Internal SDK
  41. /*!
  42. * \~chinese
  43. * 初始化错误实例
  44. *
  45. * @param aDescription 错误描述
  46. * @param aCode 错误码
  47. *
  48. * @result 错误实例
  49. *
  50. * \~english
  51. * Initialize an error instance
  52. *
  53. * @param aDescription Error description
  54. * @param aCode Error code
  55. *
  56. * @result Error instance
  57. */
  58. - (instancetype)initWithDescription:(NSString *)aDescription
  59. code:(EMErrorCode)aCode;
  60. /*!
  61. * \~chinese
  62. * 创建错误实例
  63. *
  64. * @param aDescription 错误描述
  65. * @param aCode 错误码
  66. *
  67. * @result 对象实例
  68. *
  69. * \~english
  70. * Create a error instance
  71. *
  72. * @param aDescription Error description
  73. * @param aCode Error code
  74. *
  75. * @result Error instance
  76. */
  77. + (instancetype)errorWithDescription:(NSString *)aDescription
  78. code:(EMErrorCode)aCode;
  79. @end