summaryrefslogtreecommitdiff
path: root/state.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroenwijenbergh@protonmail.com>2022-04-25 16:27:25 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-25 16:27:25 +0200
commit44df9cb92abe66cf12e887ef19e60a01461b3558 (patch)
treec24ba1580a65c681d3dba4d77cd2042803396143 /state.go
parentee1c5a9ada755a51efa2fbf054f4382d00c70dee (diff)
Tests: Ability to add a custom server and share certificate
We also now do not have to skip verification in the test files
Diffstat (limited to 'state.go')
-rw-r--r--state.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/state.go b/state.go
index bafdfb9..6f71cb3 100644
--- a/state.go
+++ b/state.go
@@ -86,7 +86,11 @@ func (state *VPNState) Connect(url string) (string, error) {
return "", errors.New("app not registered")
}
// New server chosen, ensure the server is fresh
- server := state.Servers.EnsureServer(url, &state.FSM, &state.Logger)
+ server, serverErr := state.Servers.EnsureServer(url, &state.FSM, &state.Logger)
+
+ if serverErr != nil {
+ return "", serverErr
+ }
// Make sure we are in the chosen state if available
state.FSM.GoTransition(internal.CHOSEN_SERVER)
// Relogin with oauth