GW2FileErrorMsg
GW2FileErrorMsg 関数は、指定された session ID についてGlasswallが報告したエラーメッセージを取得します。エラーメッセージは出力バッファに格納されます。
エラーの理由が複数ある場合、この関数呼び出しで報告されるのは1つだけです。障害の詳細が必要な場合は、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 列挙値を返します。負の数は失敗を示します。
概要
/// <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 列挙値を返します。負の数は失敗を示します。
概要
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 列挙値を返します。負の数は失敗を示します。
例
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;
}