You are viewing limited content. For full access, please sign in.

Question

Question

Client Automation Tools Log In - Error Handling

asked on October 7, 2015

Hi all,

I'm trying to use CAT to open an instance of the Laserfiche Client and log in, but I'm wanting to be able to handle errors within my application, such as when a user is unable to log in because they have entered the wrong password etc. Is this possible to do? At the moment I'm struggling as a MessageBox is displayed to the user with the problem from the LF Client, but I'm unable to do anything with this from my application.

Thanks in advance!

Kind regards,

Ronald

0 0

Answer

SELECTED ANSWER
replied on October 7, 2015

When CAT launches the client it releases control until login completes (or times out after 60 seconds). I think your application should have its own prompt for the username/password, you verify the login by logging in with RepositoryAccess (or LFSO) and then call LaunchClient with the username and password. It's not ideal since there will be two logins, but it gives you more control.

1 0

Replies

replied on October 7, 2015 Show version history

Ronald,

If you check out the CAT sample  projects that were installed with the SDK it looks like they recommend using a 'While True' loop for the application entry point that should capture a failed login and allow you to pop-up a dialog for a retry.  If the client successfully loads then that called routine returns a value that you can test to exit that endless loop.  My guess is that a failed client login will throw an exception that you can trap in this entry point routine.

Here is a snippet of from one of the CAT sample projects;

    ''' <summary>
    ''' The main entry point for the application.
    ''' </summary>
    Shared Sub Main(args As String())
        Dim strCommands As String = ""
        For i As Integer = 0 To args.Length - 1
            If i > 0 Then
                strCommands += " "
            End If
            strCommands += args(i)
        Next

        While True
            Try
                If MainHandler(args) Then
                    Exit While
                End If
            Catch e As Exception
                Dim result As DialogResult = MessageBox.Show(e.Message & ", Retry?", "Error", MessageBoxButtons.YesNo)
                If result = DialogResult.No Then
                    Exit While
                End If
            End Try
        End While
    End Sub

It also looks like you can specifically trap Laserfiche CAT exceptions in the above code with something like this;

Catch lfex As Laserfiche.ClientAutomation.ClientAutomationException

 

1 0
replied on October 7, 2015

That is not currently possible, we will look into adding support for it.

1 0
replied on October 7, 2015

Is there no way to launch the client with CAT using a session that has already been created? In a similar way that a session can be shared between LFSO and RA using the ILFConnection.SerializedConnection property? If not, is this something that will be looked at in the future?

Thanks for all the help :)

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.