- SE AGREGO CODIGO PARA EN ELNVIO DE ERRORES

This commit is contained in:
2024-03-23 16:04:24 -06:00
parent 79d74e2fdb
commit 2d4e8dd2d2
8 changed files with 302 additions and 92 deletions

View File

@@ -39,6 +39,9 @@ Sub Process_Globals
Dim horacomin As String
Dim horacomout As String
Dim trabaja As Int
'Para los Logs
Dim logs As StringBuilder
Private logcat As LogCat
End Sub
Sub Service_Create
@@ -61,8 +64,19 @@ Sub Service_TaskRemoved
Timer1.Enabled = False
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
'Return true to allow the OS default exceptions handler to handle the uncaught exception. 'Para los Logs
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
'wait for 500ms to allow the logs to be updated.
Log(">>>>>>>>> ERROR")
Dim jo As JavaObject
Dim l As Long = 500: jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array(l)) 'Sleep 500ms
logcat.LogCatStop
logs.Initialize
logs.Append(Application.LabelName & " Ver " & Application.VersionName & CRLF)
logs.Append(StackTrace)
Subs.revisaBD
Subs.errorLog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)", Array As Object (Subs.fechaKMT(DateTime.now), logs))
StartActivity(errorManager)
Return True
End Sub
@@ -70,7 +84,6 @@ Sub Service_Destroy
End Sub
Private Sub Timer1_Tick
' ToastMessageShow("Timer",False)
' If logger Then Log("Siguiente actuaizacion " & DateTime.Time(DateTime.Now + Interval * 1000))