Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message on YAML syntax error #10

Closed
phanect opened this issue Oct 2, 2015 · 2 comments
Closed

Better error message on YAML syntax error #10

phanect opened this issue Oct 2, 2015 · 2 comments

Comments

@phanect
Copy link

phanect commented Oct 2, 2015

I'm using robo 0.3.0 and prepared following YAML file.

robo.yml

runsql:
  summary: Run SQL
  command: |
    # ...
    if [ ! mysql --host "$db_server_ip" --user root --password --execute << _SQL_
      # SQL...
_SQL_ ]; then # This YAML syntax error causes the error
      echo "Failed to login"
    fi

I cded to the directory where above YAML file is and run robo setup, then follwing error is shown:

$ robo runsql
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4389dc]

goroutine 1 [running]:
github.com/tj/robo/config.New(0xc2080340f2, 0x8, 0xc208032320, 0x0, 0x0)
        /Users/tj/dev/src/github.com/tj/robo/config/config.go:29 +0x13c
main.main()
        /Users/tj/dev/src/github.com/tj/robo/main.go:40 +0x24a

goroutine 2 [runnable]:
runtime.forcegchelper()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/proc.go:90
runtime.goexit()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/mgc0.go:82
runtime.goexit()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/malloc.go:712
runtime.goexit()
        /usr/local/Cellar/go/1.4.1/libexec/src/runtime/asm_amd64.s:2232 +0x1

This error is derived from YAML syntax error commented in above YAML file.
I would like better error message.

I'm on Kubuntu 15.04 64bit

@phanect phanect changed the title panic: runtime error: invalid memory address or nil pointer dereference Better error message on YAML syntax error Oct 2, 2015
@tj
Copy link
Owner

tj commented Oct 14, 2015

hey sorry, missed this!

@tj tj closed this as completed in 04798cb Oct 14, 2015
@phanect
Copy link
Author

phanect commented Oct 14, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants