getError static method

TonConnectError getError(
  1. ConnectEventErrorCodes errorCodes,
  2. String? message
)

Implementation

static TonConnectError getError(
    ConnectEventErrorCodes errorCodes, String? message) {
  switch (errorCodes) {
    case ConnectEventErrorCodes.unknownError:
      return UnknownError(message);
    case ConnectEventErrorCodes.badRequestError:
      return BadRequestError(message);
    case ConnectEventErrorCodes.mainfestNotFoundError:
      return ManifestNotFoundError(message);
    case ConnectEventErrorCodes.mainfestConnectError:
      return ManifestContentError(message);
    case ConnectEventErrorCodes.unknownAppError:
      return UnknownAppError(message);
    case ConnectEventErrorCodes.userRejectsError:
      return UserRejectsError(message);
    case ConnectEventErrorCodes.methodNotSupported:
      return ManifestContentError(message);
    default:
      return UnknownError(message);
  }
}