summaryrefslogtreecommitdiff
path: root/internal/openvpn.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/openvpn.go')
-rw-r--r--internal/openvpn.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/openvpn.go b/internal/openvpn.go
index 1b2e626..ed31fe2 100644
--- a/internal/openvpn.go
+++ b/internal/openvpn.go
@@ -1,12 +1,22 @@
package internal
+import "fmt"
+
func (server *Server) OpenVPNGetConfig() (string, error) {
profile_id := server.Profiles.Current
configOpenVPN, _, configErr := server.APIConnectOpenVPN(profile_id)
if configErr != nil {
- return "", configErr
+ return "", &OpenVPNGetConfigError{Err: configErr}
}
return configOpenVPN, nil
}
+
+type OpenVPNGetConfigError struct {
+ Err error
+}
+
+func (e *OpenVPNGetConfigError) Error() string {
+ return fmt.Sprintf("failed getting OpenVPN config with error: %v", e.Err)
+}