summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exports/disco.go12
-rw-r--r--wrappers/python/eduvpn_common/main.py10
2 files changed, 4 insertions, 18 deletions
diff --git a/exports/disco.go b/exports/disco.go
index e18df3d..5fd027c 100644
--- a/exports/disco.go
+++ b/exports/disco.go
@@ -176,10 +176,6 @@ func GetDiscoServers(name *C.char) (*C.discoveryServers, *C.error) {
return nil, getError(stateErr)
}
servers, serversErr := state.DiscoServers()
- if serversErr != nil {
- return nil, getError(serversErr)
- }
-
returnedStruct := (*C.discoveryServers)(
C.malloc(C.size_t(unsafe.Sizeof(C.discoveryServers{}))),
)
@@ -188,7 +184,7 @@ func GetDiscoServers(name *C.char) (*C.discoveryServers, *C.error) {
state,
servers,
)
- return returnedStruct, nil
+ return returnedStruct, getError(serversErr)
}
//export GetDiscoOrganizations
@@ -199,10 +195,6 @@ func GetDiscoOrganizations(name *C.char) (*C.discoveryOrganizations, *C.error) {
return nil, getError(stateErr)
}
organizations, organizationsErr := state.DiscoOrganizations()
- if organizationsErr != nil {
- return nil, getError(organizationsErr)
- }
-
returnedStruct := (*C.discoveryOrganizations)(
C.malloc(C.size_t(unsafe.Sizeof(C.discoveryOrganizations{}))),
)
@@ -213,5 +205,5 @@ func GetDiscoOrganizations(name *C.char) (*C.discoveryOrganizations, *C.error) {
organizations,
)
- return returnedStruct, nil
+ return returnedStruct, getError(organizationsErr)
}
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py
index 7e96d6a..e27ec55 100644
--- a/wrappers/python/eduvpn_common/main.py
+++ b/wrappers/python/eduvpn_common/main.py
@@ -120,14 +120,11 @@ class EduVPN(object):
:return: The disco Servers if any
:rtype: Optional[DiscoServers]
"""
- servers, servers_err = self.go_function(
+ servers, _ = self.go_function(
self.lib.GetDiscoServers,
decode_func=lambda lib, x: get_data_error(lib, x, get_disco_servers),
)
- if servers_err:
- raise servers_err
-
return servers
def get_disco_organizations(self) -> Optional[DiscoOrganizations]:
@@ -138,14 +135,11 @@ class EduVPN(object):
:return: The discovery Organizations if any
:rtype: Optional[DiscoOrganizations]
"""
- organizations, organizations_err = self.go_function(
+ organizations, _ = self.go_function(
self.lib.GetDiscoOrganizations,
decode_func=lambda lib, x: get_data_error(lib, x, get_disco_organizations),
)
- if organizations_err:
- raise organizations_err
-
return organizations
def add_institute_access(self, url: str) -> None: