Entfernen unnötige try-catch-Anweisungen.
This commit is contained in:
@@ -286,9 +286,7 @@ Public Class EnvelopeEditorController
|
||||
Dim oTransaction = oConnection.BeginTransaction()
|
||||
|
||||
Try
|
||||
If InsertReceivers(pNewReceivers, oTransaction) = False Then
|
||||
Throw New ApplicationException("Could not insert receivers!")
|
||||
End If
|
||||
InsertReceivers(pNewReceivers, oTransaction)
|
||||
|
||||
oTransaction.Commit()
|
||||
|
||||
@@ -382,17 +380,15 @@ Public Class EnvelopeEditorController
|
||||
Return ElementModel.ElementsExist(Envelope.Id, pReceiverId)
|
||||
End Function
|
||||
|
||||
Private Function InsertReceivers(pReceivers As List(Of Receiver), pTransaction As SqlTransaction) As Boolean
|
||||
Try
|
||||
Return pReceivers.
|
||||
Select(Function(r) InsertReceiver(r, pTransaction)).
|
||||
All(Function(pResult) pResult = True)
|
||||
Private Sub InsertReceivers(pReceivers As List(Of Receiver), pTransaction As SqlTransaction)
|
||||
Dim status = pReceivers.
|
||||
Select(Function(r) InsertReceiver(r, pTransaction)).
|
||||
All(Function(pResult) pResult = True)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
If Not status Then
|
||||
Throw New ApplicationException("Could not insert receivers!")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function AssignReceivers(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
|
||||
If ReceiverModel.Unassign(pEnvelope, pTransaction) = False Then
|
||||
|
||||
Reference in New Issue
Block a user