No Description

error.ts 402B

123456789101112131415161718192021222324252627
  1. export class WebsocketError {
  2. private _code: number;
  3. private _msg: string;
  4. /**
  5. * 构造函数
  6. */
  7. public constructor(code: number, msg: string) {
  8. this._code = code;
  9. this._msg = msg;
  10. }
  11. /**
  12. * 返回错误码
  13. */
  14. public get code(): number {
  15. return this._code;
  16. }
  17. /**
  18. * 返回具体的错误信息
  19. */
  20. public get msg(): string {
  21. return this._msg;
  22. }
  23. }