diff --git a/EnvelopeGenerator.Form/Controllers/BaseController.vb b/EnvelopeGenerator.Form/Controllers/BaseController.vb index 39dff0f4..267b065b 100644 --- a/EnvelopeGenerator.Form/Controllers/BaseController.vb +++ b/EnvelopeGenerator.Form/Controllers/BaseController.vb @@ -135,7 +135,10 @@ Public MustInherit Class BaseController Public Function DeleteDocumentFromDisk(pDocument As EnvelopeDocument) As Boolean Try - IO.File.Delete(pDocument.Filepath) + If IO.File.Exists(pDocument.Filepath) Then + IO.File.Delete(pDocument.Filepath) + End If + Return True Catch ex As Exception Logger.Error(ex) diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index 7fe1b959..4957c540 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -369,11 +369,11 @@ Partial Public Class frmEnvelopeEditor End If System.IO.File.Move(pSourcePath, pDestinationPath) Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in FileMove") + MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in MoveFileWithNetUse") End Try Else - MsgBox("Fehler beim Verbinden mit dem Netzwerkziel.", MsgBoxStyle.Critical) + MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in MoveFileWithNetUse") End If End Using End Sub