OpenVidu sendRequest 오버라이딩 예외처리

PARKHEECHANG·2023년 8월 22일
0

OpenVidu

목록 보기
5/8
post-thumbnail

const OV = useRef(new OpenVidu());
// ######### sendRequest 오버라이딩 예외처리
OV.current.sendRequest = function (method, params, callback) {
  try {
    if (params && typeof params === 'function') {
      callback = params;
      params = {};
    }
    console.debug(
      'Sending request: {method:"' +
        method +
        '", params: ' +
        JSON.stringify(params) +
        '}',
    );
    if (this.jsonRpcClient) {
      this.jsonRpcClient.send(method, params, callback);
    }
  } catch (error) {
    console.error('An error occurred while sending the request:', error);
  }
};

0개의 댓글