Hi all,
I have a B4J server app that sometime capture an error in the main thread, but I can't discover where it is generated.
I have this code in main thread:
But in the text file I read only these info:
2020-12-04 16:16:36 App Error 1: (FileNotFoundException) java.io.FileNotFoundException: C:\Users\ADMINI~1\AppData\Local\Temp\2\32372 (The system cannot find the file specified)
Any hints how to debug it ?
I have a B4J server app that sometime capture an error in the main thread, but I can't discover where it is generated.
I have this code in main thread:
B4X:
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Dim TextWriter1 As TextWriter
TextWriter1.Initialize(File.OpenOutput(File.DirApp, "AppError.log",True))
Dim er As StringBuilder
er.Initialize
Dim dt As String=Mysub.mydate(DateTime.Now, "yyyy-MM-dd HH:mm:ss")
If srvr.CurrentThreadIndex = 0 Then 'main thread
LogError(StackTrace)
er.Append(dt & " App Error 1: " & Error & CRLF)
er.Append(Error & CRLF)
er.Append(StackTrace & CRLF & CRLF & CRLF & CRLF)
TextWriter1.Write(er.ToString)
TextWriter1.Close
Return False
Else 'handlers threads
Log(dt & " App Error 2: " & Error)
er.Append(dt & " App Error 2: " & Error & CRLF)
er.Append(Error & CRLF)
er.Append(StackTrace & CRLF & CRLF & CRLF & CRLF)
TextWriter1.Write(er.ToString)
TextWriter1.Close
Return True
End If
End Sub
But in the text file I read only these info:
2020-12-04 16:16:36 App Error 1: (FileNotFoundException) java.io.FileNotFoundException: C:\Users\ADMINI~1\AppData\Local\Temp\2\32372 (The system cannot find the file specified)
Any hints how to debug it ?