Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
37ebb839
Commit
37ebb839
authored
Jul 17, 2020
by
legoc
Browse files
Process error in SessionManager.login()
parent
67924e18
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/nscclient/sessionmanagement/SessionManager.java
View file @
37ebb839
...
...
@@ -50,6 +50,9 @@ public class SessionManager {
public
class
ClientAlreadyLaunchedException
extends
Exception
{};
public
class
MultipleConnectionsPerUserNotAllowedException
extends
Exception
{};
public
class
MultipleClientsPerEndpointNotAllowedException
extends
Exception
{};
/*
* Constructor. Use private constructor to enforce singleton pattern.
...
...
@@ -134,8 +137,11 @@ public class SessionManager {
try
{
Common
.
Int32Response
response
=
Common
.
Int32Response
.
parseFrom
(
sessionRequester
.
receive
());
// TODO: refine the behaviour depending on the error: MULTIPLE_CONNECTIONS_PER_USER_NOT_ALLOWED, MULTIPLE_CLIENTS_PER_ENDPOINT_NOT_ALLOWED.
if
(
response
.
hasError
())
{
// Process the error.
if
(
response
.
getError
()
==
Common
.
Error
.
Type
.
MULTIPLE_CONNECTIONS_PER_USER_NOT_ALLOWED
)
{
throw
new
ClientAlreadyLaunchedException
();
}
else
if
(
response
.
getError
()
==
Common
.
Error
.
Type
.
MULTIPLE_CLIENTS_PER_ENDPOINT_NOT_ALLOWED
)
{
throw
new
ClientAlreadyLaunchedException
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment