How to differentiate between error due to authorization and wrong server url in OpenCMIS?

136 views Asked by At

By default, the inmemory repository has no username or password. Is there a way I can setup a username and password for it?

If not, the SessionFactory.createSession() always throws a CmisBaseException. How do i differentiate between failure due to wrong server url and authentication error? The error due to wrong server url contained a CmisConnectionException. I'm unable to find out what exception class is used in case of wrong username and password.

Please reply as early as possible.

1

There are 1 answers

0
Rajath S On

Although I could not change the login credentials for the inmemory repository, I was able to differentiate between authorization error and wrong url error.

Here is what I did:

I tried logging into a nuxexo test server through my client with wrong user credentials: I caught a CmisBaseException. But, on obtaining the class name of the exception, it is: CmisUnauthorizedException

I tried with a wrong server url: I caught a CmisBaseException, But, the class name of the exception is CmisConnectionException.

So, one can make use of this property to differentiate between the two errors.