Skip to content

Commit

Permalink
optimize(outline): more detailed error log
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed Dec 25, 2020
1 parent 18f0b97 commit 3502e03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/outline.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"bytes"
"encoding/json"
"fmt"
"golang.org/x/crypto/ssh"
Expand Down Expand Up @@ -54,7 +55,12 @@ func (outline Outline) getConfig() ([]byte, error) {
return nil, fmt.Errorf("failed to create session: %v", err)
}
defer session.Close()
return session.Output("cat /opt/outline/persisted-state/shadowbox_config.json")
out, err := session.CombinedOutput("cat /opt/outline/persisted-state/shadowbox_config.json")
if err != nil {
err = fmt.Errorf("%v: %v", string(bytes.TrimSpace(out)), err)
return nil, err
}
return out, nil
}

func (outline Outline) GetServers() (servers []Server, err error) {
Expand Down

0 comments on commit 3502e03

Please sign in to comment.