GW2FileErrorMsg
GW2FileErrorMsg 함수는 지정된 session ID에 대해 Glasswall이 보고한 오류 메시지를 가져옵니다. 오류 메시지는 출력 버퍼에 저장됩니다.
오류의 원인이 둘 이상인 경우 이 함수 호출에서는 그중 하나만 보고됩니다. 실패에 대한 세부 정보가 필요한 경우, 세션에서 GW2RegisterAnalysisFile 또는 GW2AnalysisRegisterMemory 함수 중 하나를 호출했다면 생성된 분석 보고서에 해당 정보가 포함됩니다. 그렇지 않은 경우, 자세한 분석 보고서를 생성하기 위해 다른 세션에서 해당 함수 중 하나를 사용하여 문서를 Glasswall로 처리할 수 있습니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
#include "glasswall.core2.api.h"
// The **GW2FileErrorMsg** function retrieves the error message reported by Glasswall.
// A pointer to the error message is placed in the object pointed to by **errorMsgBuffer**
// and the size, in bytes, of the error message is placed in the **size_t** object
// pointed to by **errorMsgBufferLength**.
int GW2FileErrorMsg(
Session session,
char **errorMsgBuffer,
size_t *errorMsgBufferLength);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
/// <summary>
///
/// </summary>
/// <param name="session">Session ID number</param>
/// <param name="outputBuffer">Location in memory where the error message will be placed</param>
/// <param name="bufferLength">Size of the output buffer</param>
public int FileErrorMsg(
int session,
out IntPtr outputBuffer,
ref UIntPtr bufferLength)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public String GW2FileErrorMsgString(int session) throws GlasswallException
참고
The GW2FileErrorMsgString function parameters have been updated to use String in place of byte[], and to remove the need to call GetErrorBuffer to retrieve the data. The original functions have been deprecated.
반환값
GW2FileErrorMsgString은 세션 오류 메시지를 포함하는 String을 반환합니다. 가져올 오류 메시지가 없으면 String은 비어 있습니다.
GlasswallException 예외는 session이 유효하지 않거나 오류 메시지를 가져올 수 없는 경우 발생합니다.
개요 - 지원 중단된 함수
import com.glasswall.core2javabridge.*;
(Deprecated)
public int GW2FileErrorMsg(int session) throws GlasswallException
public byte[] GetErrorBuffer(int session) throws GlasswallException
설명
GW2FileErrorMsg 함수는 session으로 지정된 세션의 파일 오류 메시지를 내부 버퍼에 출력합니다. 오류 메시지 데이터를 가져오려면 GW2RunSession을 호출한 후 GetErrorBuffer를 호출하십시오.
format에 유효한 열거자에 대해서는 API Overview/Return types를 참조하십시오.
반환값 - 지원 중단된 함수
GW2FileErrorMsg 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하십시오.
GetErrorBuffer 함수는 오류 세부 정보를 포함하는 바이트 배열을 반환합니다. GW2FileErrorMsg가 호출되지 않은 경우 이는 null입니다.
GlasswallException 예외는 session이 유효하지 않거나 오류 메시지를 가져올 수 없는 경우 발생합니다.
개요
Glasswall Session Process 오류 메시지를 검색합니다.
def file_error_message(self, session: int) -> str:
""" Retrieve the Glasswall Session Process error message.
Args:
session (int): The session integer.
Returns:
error_message (str): The Glasswall Session Process error message.
"""
반환값
문자열 형식의 오류 메시지입니다.
개요
/**
* This function retrieves the error message reported by Glasswall. If more than one error
* is reported, the last one will be returned.
*
*/
GW2FileErrorMsg(
session,
errorMsgBuffer,
errorMsgBufferLength)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
예제
function getFileErrorMsg(session_id, gw) {
/*
GW2FileErrorMsg API signature
int GW2FileErrorMsg(
Session session,
char **errorMsgBuffer,
size_t *errorMsgBufferLength
);
*/
// allocate pointer space to store the pointer to the message buffer
let CString_ptr = ref.refType(ref.types.CString);
let errorMsgBuffer = ref.alloc(CString_ptr);
// allocate space to store the buffer length; use .deref() to extract it
let errorMsgBufferLength = ref.alloc('size_t');
let rv = gw.GW2FileErrorMsg(session_id, errorMsgBuffer, errorMsgBufferLength);
buf_len = errorMsgBufferLength.deref();
if (buf_len == 0)
arr_buf = "";
else
arr_buf = buffer_to_array(errorMsgBuffer, errorMsgBufferLength);
let message = `\n GW2FileErrorMsg:return=${rv}`;
message += "\n errorMsgBuffer = \"" + arr_buf.toString() + '"';
message += `\n errorMsgBufferLength = ${buf_len}`;
return message;
}