Version: 2020.2
LanguageEnglish
  • C#

AtomicSafetyHandle.SetCustomErrorMessage

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static void SetCustomErrorMessage(int staticSafetyId, Unity.Collections.LowLevel.Unsafe.AtomicSafetyErrorType errorType, byte* messageBytes, int byteCount);

Parameters

staticSafetyId The static safety ID with which the provided custom error message should be associated. This ID must have been allocated with NewStaticSafetyId. Passing 0 is invalid; this is the default static safety ID, and its error messages can not be modified.
errorType The class of error that should use the provided custom error message instead of the default job debugger error message.
messageBytes The error message to use for the specified error type. This is expected to be a UTF8-encoded byte array, and is not required to be null-terminated.
byteCount The number of bytes in the messageBytes array, excluding the optional null terminator.

Description

Provide a custom error message for a specific job debugger error type, in cases where additional context can be provided.

The job debugger looks up error messages for AtomicSafetyHandles using the specified static safety ID and error type. You should provide a message for each applicable type of error defined in AtomicSafetyErrorType. Without a specific error message, the job debugger can only emit general error messages that may not clearly identify the source of the error.

If the message contains any of the following sequences, they will be replaced with the corresponding context-specific data (if available) when the message is emitted: - {2} = this job name. example: "BoidsJob"
- {3} = this job field. example: "BoidsJob.boidsBuffer"
- {5} = this owner type. example: "NativeArray<int>"

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961