cciThrowExceptionW

예외를 전달합니다. 예외 데이터로 지정된 인수를 사용하여 메시지 브로커 인터페이스가 예외를 전달합니다.

구문

void cciThrowExceptionW(
  int*                   returnCode,
    CCI_EXCEPTION_TYPE  type,
  const char*         file,
    int                 line,
  const char*         function,
  const CciChar*      messageSource,
    int                 messageNumber,
  const CciChar*      traceText,
                      ...
);

매개변수

returnCode
함수의 리턴 코드(출력). messageSource 매개변수가 널(Null)이면 returnCode가 CCI_INV_DATA_POINTER로 설정됩니다.
type
예외의 유형(입력). 올바른 값은 다음과 같습니다.
  • CCI_FATAL_EXCEPTION
  • CCI_RECOVERABLE_EXCEPTION
  • CCI_CONFIGURATION_EXCEPTION
  • CCI_PARSER_EXCEPTION
  • CCI_CONVERSION_EXCEPTION
  • CCI_DATABASE_EXCEPTION
  • CCI_USER_EXCEPTION
file
예외가 생성된 소스 파일 이름(입력). 값은 선택적이지만 디버깅용으로 유용합니다.
line
예외가 생성된 소스 파일의 행 번호(입력). 값은 선택적이지만 디버깅용으로 유용합니다.
function
예외가 생성된 함수 이름(입력). 값은 선택적이지만 디버깅용으로 유용합니다.
messageSource
Windows 메시지 소스 또는 LinuxUNIX 메시지 카탈로그를 식별하는 문자열. 현재 WebSphere Message Broker 버전 메시지 카탈로그를 사용하려면 모든 운영 체제에서 BIPV600을 사용하십시오.
messageNumber
예외를 나타내는 메시지 번호(입력). messageNumber가 0으로 지정된 경우, 메시지가 사용 불가능한 것으로 간주됩니다. messageNumber가 0이 아닌 경우, 변수 인수 목록에 제공된 모든 삽입항목과 함께 브로커 이벤트 로그에 지정된 메시지가 기록됩니다.
traceText
브로커 서비스 추적 로그에 기록된 추적 정보(입력). 정보는 선택사항이지만 디버깅용으로 유용합니다.
...
메시지와 함께 오는 모든 메시지 삽입 항목이 들어 있는 C 변수 인수 목록(입력). 이러한 삽입 항목은 문자열로 처리되며 변수 인수는 pointer to CciChar 유형으로 간주됩니다.
주: 이 목록의 마지막 인수는 반드시 (Ccichar*)0이어야 합니다.

리턴 값

없음. 오류가 발생할 경우, returnCode 매개변수는 오류의 이유를 표시합니다.

void raiseExceptionWithBroker(CciChar* helpfulText, 
                              char* file, /* which source file is broken */
                              int line,   /* line in above file */
                              char* func  /* function in above file */
                              ){
    int          rc = CCI_SUCCESS;
  
  /* Set up the message catalog name */
  const char* catalog = "BIPv600";
  
  /* Convert the catalog name to wide characters. 
   * BIP_DEF_COMP_CCSID is UTF-8 on distributed and LATIN1 on z/OS 
   */
  int maxChars =  strlen(catalog)+1;
  CciChar* wCatalog =(CciChar*)malloc(maxChars*sizeof(CciChar));
  cciMbsToUcs(&rc, catalog, wCatalog, maxChars, BIP_DEF_COMP_CCSID);

  /* The above might have failed, but we are already throwing an exception,
   * so rc is now set to type success. */
  rc = CCI_SUCCESS;

  /* Throw the exception. The explanation will be added as the traceText and
   *  as an insert to the message 
   */
  cciThrowExceptionW(&rc,
                     CCI_FATAL_EXCEPTION,
                     file, line, func,
                     wCatalog, BIP2111,  
                     helpfulText,  
                     helpfulText,  
                     (CciChar*)0 
                     );     
  /* The above might have failed, but we are already throwing an exception,
   * so the value of rc is not important. */
}
주의사항 | 등록상표 | 다운로드 | 라이브러리 | 지원 | 피드백
Copyright IBM Corporation 1999, 2006 마지막 갱신 날짜: 2006/08/21
as24560_