eldarion-gondor / gondor

Gondor client command-line tool
1 stars 0 forks source link

`g3a open` needs human friendly errors #4

Closed secretfader closed 8 years ago

secretfader commented 8 years ago

When leaving off the service name (g3a open), the CLI panics:

nicholaswyoung$ g3a open
panic: runtime error: index out of range

goroutine 1 [running]:
main.openCmd(0xc8200d40f0)
    /Users/brian/Development/Go/src/github.com/eldarion-gondor/cli/src/open.go:13 +0x2c1
main.stdCmd.func1(0xc8200d40f0)
    /Users/brian/Development/Go/src/github.com/eldarion-gondor/cli/src/main.go:45 +0x1ff
github.com/codegangsta/cli.Command.Run(0x4e50e0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5463e0, 0x1c, 0x0, ...)
    /Users/brian/Development/Go/src/github.com/eldarion-gondor/cli/Godeps/_workspace/src/github.com/codegangsta/cli/command.go:127 +0x1052
github.com/codegangsta/cli.(*App).Run(0xc82009a700, 0xc82000a1a0, 0x2, 0x2, 0x0, 0x0)
    /Users/brian/Development/Go/src/github.com/eldarion-gondor/cli/Godeps/_workspace/src/github.com/codegangsta/cli/app.go:159 +0xc2f
main.main()
    /Users/brian/Development/Go/src/github.com/eldarion-gondor/cli/src/main.go:764 +0x5ca1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/Cellar/go/1.5.2/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/Cellar/go/1.5.2/libexec/src/os/signal/signal_unix.go:28 +0x37

goroutine 51 [IO wait]:
net.runtime_pollWait(0x973928, 0x72, 0xc82000e160)
    /usr/local/Cellar/go/1.5.2/libexec/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200c3250, 0x72, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200c3250, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8200c31f0, 0xc820116000, 0x1000, 0x1000, 0x0, 0x96e050, 0xc82000e160)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc8200320d0, 0xc820116000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8200caae0, 0x973d10, 0xc8200320d0, 0x5, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820080b00, 0x5aa617, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820080b00, 0xc8200ea000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x9ef390, 0xc820080b00, 0xc8200ba268, 0xc8200ea000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc82051a2e0, 0xc8200ea000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc8204548a0)
    /usr/local/Cellar/go/1.5.2/libexec/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8204548a0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200ba210)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:685 +0xc78

goroutine 52 [select]:
net/http.(*persistConn).writeLoop(0xc8200ba210)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:686 +0xc9d

goroutine 60 [IO wait]:
net.runtime_pollWait(0x973868, 0x72, 0xc82000e160)
    /usr/local/Cellar/go/1.5.2/libexec/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82005f090, 0x72, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82005f090, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82005f030, 0xc820117000, 0x1000, 0x1000, 0x0, 0x96e050, 0xc82000e160)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820032198, 0xc820117000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc82050fd70, 0x973d10, 0xc820032198, 0x5, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820275600, 0x5aa617, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820275600, 0xc8203e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x9ef390, 0xc820275600, 0xc8204c05d8, 0xc8203e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8204e0180, 0xc8203e2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc8202363c0)
    /usr/local/Cellar/go/1.5.2/libexec/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc8202363c0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.5.2/libexec/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8204c0580)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:685 +0xc78

goroutine 61 [select]:
net/http.(*persistConn).writeLoop(0xc8204c0580)
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go/1.5.2/libexec/src/net/http/transport.go:686 +0xc9d