Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
catch(ex)
{
console.log(ex.toString());
//
// Handle any exceptions that occurred during session creation.
//
if(ex instanceof Glacier2.PermissionDeniedException)
{
await setState(State.Disconnected, "permission denied:\n" + ex.reason);
}
else if(ex instanceof Glacier2.CannotCreateSessionException)
{
await setState(State.Disconnected, "cannot create session:\n" + ex.reason);
}
else if(ex instanceof Ice.ConnectFailedException)
{
await setState(State.Disconnected, "connection to server failed");
}
else
{
await setState(State.Disconnected, ex.toString());
}
}
}
await runWithSession(router, Demo.ChatSessionPrx.uncheckedCast(session));
}
catch(ex)
{
//
// Handle any exceptions that occurred during session creation.
//
if(ex instanceof Glacier2.PermissionDeniedException)
{
await error("permission denied:\n" + ex.reason);
}
else if(ex instanceof Glacier2.CannotCreateSessionException)
{
await error("cannot create session:\n" + ex.reason);
}
else if(ex instanceof Ice.ConnectFailedException)
{
await error("connection to server failed");
}
else
{
await error(ex.toString());
}
}
finally
{
if(communicator)
{
await communicator.destroy();
}
}
}