diff options
| author | Shulhan <ms@kilabit.info> | 2023-10-12 01:30:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-10-12 01:40:22 +0700 |
| commit | 207e7f016bf96ab037f510837940c037111cd42f (patch) | |
| tree | 1f28958f818da44ebcf6548bb081418e60fb11c2 /session.go | |
| parent | 6b756d144c5cdb0a0c9b5f8a70b3c936a75f28c9 (diff) | |
| download | awwan-207e7f016bf96ab037f510837940c037111cd42f.tar.xz | |
all: return error from executeScriptOnLocal
Instead of breaking the statement when its failed to execute, return
the error to the caller, Local.
Diffstat (limited to 'session.go')
| -rw-r--r-- | session.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -309,7 +309,7 @@ func (ses *Session) executeRequires(req *Request, pos linePosition) (err error) return nil } -func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) { +func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) (err error) { var max = int64(len(req.script.stmts)) if pos.start > max { return @@ -332,7 +332,6 @@ func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) { fmt.Fprintf(req.stdout, "\n--> local: %3d: %s\n", x, stmt.String()) - var err error switch stmt.kind { case statementKindDefault: err = ses.ExecLocal(req, stmt) @@ -347,9 +346,10 @@ func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) { } if err != nil { fmt.Fprintf(req.stderr, "!!! %s\n", err) - break + return err } } + return nil } func (ses *Session) executeScriptOnRemote(req *Request, pos linePosition) { |
