From 97806fe9cd426f36fb46f211af1362b0650bae92 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 4 Feb 2020 16:06:47 +0100 Subject: [PATCH] clean up frmFileTest --- GUIs.ClientSuite/_TEST/frmFileTest.vb | 21 ++++++++++----------- Modules.EDMIAPI/Document.vb | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/GUIs.ClientSuite/_TEST/frmFileTest.vb b/GUIs.ClientSuite/_TEST/frmFileTest.vb index 1971fe08..d6cb5224 100644 --- a/GUIs.ClientSuite/_TEST/frmFileTest.vb +++ b/GUIs.ClientSuite/_TEST/frmFileTest.vb @@ -19,14 +19,12 @@ Public Class frmFileTest .Multiselect = True } - Dim oDialogResult = oDialog.ShowDialog() - - If oDialogResult <> DialogResult.OK Then + If oDialog.ShowDialog() <> DialogResult.OK Then Exit Sub End If - Try - For Each oFileName In oDialog.FileNames + For Each oFileName In oDialog.FileNames + Try Dim oSW As New Stopwatch() oSW.Start() @@ -35,7 +33,7 @@ Public Class frmFileTest oSW.Stop() If oResult.OK = False Then - MsgBox(oResult.ErrorMessage) + listboxLog.Items.Add($"Document upload failed! Reason: '{oResult.ErrorMessage}'") Exit Sub End If @@ -43,11 +41,12 @@ Public Class frmFileTest listboxLog.Items.Add($"Filename: {oResult.Document.FileName}") listboxLog.Items.Add($"Time in milliseconds: {oSW.ElapsedMilliseconds}") listboxLog.Items.Add($"----------------------------------------------------------") - Next - Catch ex As Exception - ShowErrorMessage(ex) - Logger.Error(ex) - End Try + Catch ex As Exception + listboxLog.Items.Add($"Document upload failed! Reason: '{ex.Message}'") + Logger.Error(ex) + End Try + Next + End Sub 'Private Sub btnDocByDocId_Click(sender As Object, e As EventArgs) diff --git a/Modules.EDMIAPI/Document.vb b/Modules.EDMIAPI/Document.vb index 5f1feb51..c506e664 100644 --- a/Modules.EDMIAPI/Document.vb +++ b/Modules.EDMIAPI/Document.vb @@ -33,7 +33,7 @@ Public Class Document ''' Connect to the service ''' ''' True if connection was successful, false otherwise - Public Function Connect() + Public Function Connect() As Boolean Try _channel = GetChannel()