misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-05-22 12:46:46 +02:00
parent 5ef0df0e7a
commit a3ef4e66f0
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 17 additions and 17 deletions

View file

@ -49,13 +49,13 @@ func LoadProxyScriptSource(path, source string, sess *session.Session) (err erro
// define session pointer
err = s.VM.Set("env", sess.Env.Data)
if err != nil {
log.Error( "Error while defining environment: %s", "\nTraceback:\n " + err.(*otto.Error).String() )
log.Error("Error while defining environment: %s", "\nTraceback:\n "+err.(*otto.Error).String())
return
}
err = s.defineBuiltins()
if err != nil {
log.Error( "Error while defining builtin functions: %s", "\nTraceback:\n " + err.(*otto.Error).String() )
log.Error("Error while defining builtin functions: %s", "\nTraceback:\n "+err.(*otto.Error).String())
return
}
@ -63,7 +63,7 @@ func LoadProxyScriptSource(path, source string, sess *session.Session) (err erro
if s.hasCallback("onLoad") {
_, err = s.VM.Run("onLoad()")
if err != nil {
log.Error( "Error while executing onLoad callback: %s", "\nTraceback:\n " + err.(*otto.Error).String() )
log.Error("Error while executing onLoad callback: %s", "\nTraceback:\n "+err.(*otto.Error).String())
return
}
}