@@ -12,7 +12,6 @@ import (
12
12
"strings"
13
13
14
14
"github.com/go-sql-driver/mysql"
15
- "go.k6.io/k6/js/common"
16
15
"go.k6.io/k6/lib/netext"
17
16
)
18
17
@@ -24,7 +23,7 @@ var supportedTLSVersions = map[string]uint16{ //nolint: gochecknoglobals
24
23
netext .TLS_1_3 : tls .VersionTLS13 ,
25
24
}
26
25
27
- // tlsExports add TLS releated exports to name dexports .
26
+ // tlsExports add TLS related exports to name exports .
28
27
func (mod * module ) tlsExports () {
29
28
// TLS versions
30
29
mod .exports .Named ["TLS_1_0" ] = netext .TLS_1_0
@@ -51,17 +50,16 @@ type TLSConfig struct {
51
50
52
51
// LoadTLS loads the TLS configuration for the SQL module.
53
52
func (mod * module ) LoadTLS (params map [string ]interface {}) error {
54
- runtime := mod .vu .Runtime ()
55
53
var tlsConfig * TLSConfig
56
54
if b , err := json .Marshal (params ); err != nil {
57
- common . Throw ( runtime , err )
55
+ return err
58
56
} else {
59
57
if err := json .Unmarshal (b , & tlsConfig ); err != nil {
60
- common . Throw ( runtime , err )
58
+ return err
61
59
}
62
60
}
63
61
if _ , ok := supportedTLSVersions [tlsConfig .MinVersion ]; ! ok {
64
- common . Throw ( runtime , fmt .Errorf ("unsupported TLS version: %s" , tlsConfig .MinVersion ) )
62
+ return fmt .Errorf ("unsupported TLS version: %s" , tlsConfig .MinVersion )
65
63
}
66
64
mod .tlsConfig = * tlsConfig
67
65
0 commit comments