WIP: EDMI: Improve Error Handling

This commit is contained in:
Jonathan Jenne
2020-04-15 14:44:42 +02:00
parent 62e4e409a6
commit b7a5f4d4a3
3 changed files with 32 additions and 6 deletions

View File

@@ -115,6 +115,9 @@ Public Class Form1
Private Async Sub ButtonLoadFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonLoadFile.ItemClick
Try
Dim oSWTotal As New Stopwatch()
oSWTotal.Start()
If TextboxObejctId.EditValue = "" Then
MsgBox("Please enter an object id!", MsgBoxStyle.Exclamation, "Uh oh!")
End If
@@ -126,9 +129,12 @@ Public Class Form1
oResponse.FileContents.CopyTo(oMemoryStream)
oMemoryStream.Position = 0
listboxLog.Items.Add("Stream read!")
DocumentViewer1.LoadFile(oResponse.FileName, oMemoryStream)
oSWTotal.Stop()
listboxLog.Items.Add($"File [{oResponse.FileName}] loaded: [{FormatTime(oSWTotal.ElapsedMilliseconds)}]")
Catch ex As FaultException
MsgBox(ex.Reason.ToString, MsgBoxStyle.Critical, "Error from Service")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Uh oh!")
End Try