Database: Better logging of errors
This commit is contained in:
parent
cd44125d96
commit
a955406464
@ -161,7 +161,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetDatatable failed SQLCommand [{SqlCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetDatatable failed SQLCommand [{SqlCommand}]")
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
@ -196,6 +197,7 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetDatatableWithConnection failed with SQLCommand [{SqlCommand}] and ConnectionString [{MaskConnectionString(ConnectionString)}]")
|
||||
Return Nothing
|
||||
End Try
|
||||
@ -241,7 +243,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetDatatableWithConnection2 failed SQLCommand [{SqlCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetDatatableWithConnection2 failed SQLCommand [{SqlCommand}]")
|
||||
|
||||
Return Nothing
|
||||
End Try
|
||||
@ -264,7 +267,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"ExecuteNonQuery failed SQLCommand [{SQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"ExecuteNonQuery failed SQLCommand [{SQLCommand}]")
|
||||
|
||||
Return False
|
||||
End Try
|
||||
@ -287,7 +291,8 @@ Public Class MSSQLServer
|
||||
SQLconnect.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"ExecuteNonQueryCS failed SQLCommand [{pSQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"ExecuteNonQueryCS failed SQLCommand [{pSQLCommand}]")
|
||||
|
||||
Return False
|
||||
End Try
|
||||
@ -320,7 +325,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetScalarValue failed SQLCommand [{SQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetScalarValue failed SQLCommand [{SQLCommand}]")
|
||||
|
||||
Return Nothing
|
||||
End Try
|
||||
@ -353,7 +359,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetScalarValueWithConnection failed SQLCommand [{SQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetScalarValueWithConnection failed SQLCommand [{SQLCommand}]")
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
@ -383,7 +390,8 @@ Public Class MSSQLServer
|
||||
Return SQLCommand.Parameters(OutputParameter).Value
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetScalarValue failed SQLCommand [{SQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetScalarValue failed SQLCommand [{SQLCommand}]")
|
||||
|
||||
Return Nothing
|
||||
End Try
|
||||
@ -407,7 +415,8 @@ Public Class MSSQLServer
|
||||
SQLconnect.Close()
|
||||
Return result
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"GetScalarValueConStr failed SQLCommand [{pSQLCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"GetScalarValueConStr failed SQLCommand [{pSQLCommand}]")
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
@ -440,7 +449,8 @@ Public Class MSSQLServer
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"NewExecuteNonQueryAsync failed SQLCommand [{SqlCommand}] - ERROR: {ex.Message}")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn($"NewExecuteNonQueryAsync failed SQLCommand [{SqlCommand}]")
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user