'Open a workspace by name. Returns the workspace. Raises an
WorkspaceException if something went wrong along the way.'

def openWorkspace(self, name):

    if (name not in get_workspaces_names()):
        raise WorkspaceException(("Workspace    %s    wasn't    found" % name))
    self.closeWorkspace()
    try:
        workspace = get_workspace(name)
    except Unauthorized:
        raise WorkspaceException("You're    not    authorized    to    access    this    workspace\nAdd    your    credentials    to    your    user    configuration    file    in    $HOME/.faraday/config/user.xml\nFor    example:    <couch_uri>http://john:password@127.0.0.1:5984</couch_uri>")
    except Exception as e:
        notification_center.CouchDBConnectionProblem(e)
        raise WorkspaceException(str(e))
    self.mappersManager.createMappers(name)
    self.setActiveWorkspace(workspace)
    notification_center.workspaceChanged(workspace)
    return workspace
