29/10/23 - Corrección de ErrorManager

- Se corrigio el código de errorManager para que guarde y envie correctamente los errores a la tabla PushInfo
This commit is contained in:
2023-10-29 19:52:52 -06:00
parent b42ce5947a
commit 626a4eb59c
7 changed files with 20 additions and 12 deletions

View File

@@ -596,6 +596,7 @@ Private Sub ImageView4_LongClick
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
' Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
' Subs.copiaDB(Result)
Dim x As Int = "a"
End Sub
Sub B_SERVER_Click

Binary file not shown.

View File

@@ -871,7 +871,7 @@ Version=12.5
#Region Project Attributes
#ApplicationLabel: Kelloggs Venta
#VersionCode: 3000
#VersionName: 3.10.25 PRUEBA V4
#VersionName: 3.10.29 PRUEBA V4
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#BridgeLogger:true

View File

@@ -65,7 +65,7 @@ ModuleBreakpoints7=
ModuleBreakpoints8=
ModuleBreakpoints9=
ModuleClosedNodes0=
ModuleClosedNodes1=
ModuleClosedNodes1=2
ModuleClosedNodes10=
ModuleClosedNodes11=
ModuleClosedNodes12=
@@ -88,7 +88,7 @@ ModuleClosedNodes27=
ModuleClosedNodes28=
ModuleClosedNodes29=
ModuleClosedNodes3=
ModuleClosedNodes30=
ModuleClosedNodes30=9,10,11
ModuleClosedNodes31=
ModuleClosedNodes32=
ModuleClosedNodes4=
@@ -97,6 +97,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7=
ModuleClosedNodes8=
ModuleClosedNodes9=
NavigationStack=Subs,actualizaProducto,944,0,C_Cliente,B_IMP2BAK_Click,1474,0,C_Cliente,B4XPage_Appear,436,0,C_Cliente,B_IMP2_Click,988,0,kms_helperSubs,RD_restaura_kmt_info,278,3,kms_helperSubs,RD_restaura_cat_detalle_paq,240,0,kms_helperSubs,RD_restaura_cat_gunaprod,163,0,kms_helperSubs,RD_restaura_cat_gunaprod2,187,0,B4XMainPage,p_cargaLocal_Click,678,0,B4XMainPage,b_cargaLocalOk_Click,679,0
NavigationStack=Subs,revisaBD,211,3,Subs,copiaDB,532,0,Starter,Application_Error,108,6,Visual Designer,MainPage.bal,-100,1,Visual Designer,login.bal,-100,3,errorManager,Activity_Pause,125,0,errorManager,Globals,57,0,Visual Designer,errormanager.bal,-100,6,errorManager,Activity_Resume,78,6,errorManager,Activity_Create,63,0,B4XMainPage,ImageView4_LongClick,592,0
SelectedBuild=0
VisibleModules=1,30,11,31,14,24,3,32,7,12
VisibleModules=1,30,11,24,3,31

View File

@@ -106,15 +106,18 @@ End Sub
'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("Ver " & Application.VersionName & CRLF)
logs.Append("R:" & rutaV & CRLF)
logs.Append("R:" & Subs.traeRuta & CRLF)
logs.Append(StackTrace)
Subs.revisaBD
Subs.errorLog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)", Array As Object (Subs.fechaKMT(DateTime.now), logs))
LogColor(logs, Colors.blue)
errorLog.ExecNonQuery($"INSERT INTO errores(fecha, error) VALUES ('${Subs.fechaKMT(DateTime.now)}', '${logs}')"$)
LogColor("insertamos Error", Colors.red)
StartActivity(errorManager)
Return True
End Sub

View File

@@ -214,8 +214,8 @@ Sub revisaBD 'ignore
End Try
End Try
'Tabla para la bitacora de errores
If Not(Starter.errorLog.IsInitialized) Then Starter.errorLog.Initialize(Starter.ruta, "errorLog.db", True)
Starter.errorLog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)")
If Not(Starter.errorLog.IsInitialized) Then Starter.errorLog.Initialize(File.DirInternal, "errorLog.db", True)
Starter.errorLog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha TEXT, error TEXT)")
End Sub
'Obtiene el ssid al que esta conectado el telefono

View File

@@ -80,18 +80,22 @@ Sub Activity_Resume
p_botones.Left = Round(p_principal.Width/2)-Round(p_botones.Width/2)
p_botones.Top = Activity.Height - (p_botones.Height + 80)
etText.Initialize("")
etText.TextSize = 13
' etText.Wrap = True
' Activity.RemoveViewAt(1)
svScroll.Panel.AddView(etText, 0, 0, 90%x, 80%y)
' etText.Width = svScroll.Width - 100
etText.InputType = etText.INPUT_TYPE_NONE
etText.Gravity = Gravity.TOP
etText.SingleLine = False
etText.Wrap = False
etText.Wrap = True
' Dim lblText, edtText As StringBuilder
Dim lbl As Label
lbl.Initialize("")
Activity.AddView(lbl, 0, 300, 100%x, 100%y) 'ignore
etText.Text = ""
Subs.revisaBD
c = Subs.errorLog.ExecQuery("select * from errores order by fecha desc limit 1")
' Subs.revisaBD
c = Starter.errorLog.ExecQuery("select * from errores order by fecha desc limit 1")
If c.RowCount > 0 Then
c.Position = 0
elError = c.GetString("error")