/* MY CODE */ public String GetErrorMessage() { if (error.IsValid) { return(error.GetProperty(JavaScriptPropertyId.FromString("message")).ConvertToString().ToString()); } return(base.Message); }
public void PrintJavaScriptError() { Native.JsGetProperty(this, JavaScriptPropertyId.FromString("stack"), out var stackTrace); if (stackTrace.IsValid) { Native.JsConvertValueToString(stackTrace, out var stackStringValue); Native.JsStringToPointer(stackStringValue, out var stackResultPtr, out _); var resultStackTrace = Marshal.PtrToStringUni(stackResultPtr); Debug.LogError(resultStackTrace); } else { Native.JsConvertValueToString(this, out var stringValue); Native.JsStringToPointer(stringValue, out var resultPtr, out _); var resultString = Marshal.PtrToStringUni(resultPtr); Debug.LogError(resultString); } }