EDMI: Fixes

This commit is contained in:
Jonathan Jenne 2021-02-02 16:06:41 +01:00
parent b5120e4115
commit b63c1b5052
2 changed files with 36 additions and 24 deletions

View File

@ -215,9 +215,19 @@ Public Class Client
.AccessRight = oResponse.FileRight,
.FullPath = oResponse.FullPath
}
Catch ex As FaultException(Of ObjectDoesNotExistFault)
_logger.Error(ex)
Throw ex
Catch ex As FaultException
_logger.Error(ex)
Throw ex
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function

View File

@ -395,34 +395,14 @@ Public Class EDMIService
End Try
End Function
Public Function ListFilesForUser() As DocumentListResponse Implements IEDMIService.ListFilesForUser
Try
Dim oDatatable = GetFileList()
Return New DocumentListResponse() With {
.Datatable = oDatatable
}
Catch ex As FaultException
_Logger.Error(ex)
Throw ex
Catch ex As Exception
_Logger.Error(ex)
Dim oDetails As New UnexpectedErrorFault(ex)
Throw New FaultException(Of UnexpectedErrorFault)(oDetails, oDetails.ErrorMessage)
End Try
End Function
Public Function GetFileInfoByObjectId(Data As DocumentInfoRequest) As DocumentInfoResponse Implements IEDMIService.GetFileInfoByObjectId
Try
Dim oAccessRight = GetAccessRightForObjectId(Data.UserId, Data.ObjectId)
Dim oFullPath = GetFullPathForObjectId(Data.ObjectId)
If oFullPath = String.Empty Then
Dim oDetails As New ObjectDoesNotExistFault(Data.ObjectId)
Throw New FaultException(Of ObjectDoesNotExistFault)(oDetails)
Dim oFault As New ObjectDoesNotExistFault(Data.ObjectId)
Throw New FaultException(Of ObjectDoesNotExistFault)(oFault, oFault.ErrorMessage)
End If
Return New DocumentInfoResponse With {
@ -430,6 +410,28 @@ Public Class EDMIService
.FullPath = oFullPath
}
Catch ex As FaultException
_Logger.Warn("GetFileInfoByObjectId: " & ex.Message)
_Logger.Error(ex)
Throw ex
Catch ex As Exception
Dim oDetails As New UnexpectedErrorFault(ex)
_Logger.Warn("GetFileInfoByObjectId: " & oDetails.ErrorMessage)
_Logger.Error(ex)
Throw New FaultException(Of UnexpectedErrorFault)(oDetails, oDetails.ErrorMessage)
End Try
End Function
Public Function ListFilesForUser() As DocumentListResponse Implements IEDMIService.ListFilesForUser
Try
Dim oDatatable = GetFileList()
Return New DocumentListResponse() With {
.Datatable = oDatatable
}
Catch ex As FaultException
_Logger.Error(ex)
Throw ex
@ -470,7 +472,7 @@ Public Class EDMIService
Dim oFullPath As String
If oRows.Count = 0 Then
_Logger.Warn("GetFullPathForObjectId: Full path does not exist for on object [{1}]", ObjectId)
_Logger.Warn("GetFullPathForObjectId: Full path does not exist for object [{0}]", ObjectId)
oFullPath = String.Empty
Else
Dim oRow As DataRow = oRows.First()
@ -479,7 +481,7 @@ Public Class EDMIService
Return oFullPath
Catch ex As Exception
_Logger.Warn("GetFullPathForObjectId: Unexpected Error while getting full path for object [{0}].", ObjectId)
_Logger.Warn("GetFullPathForObjectId: Unexpected Error while getting full path for object [{0}].", ObjectId)
_Logger.Error(ex)
Return String.Empty
End Try