Skip to content

Better error message on YAML syntax error #10

@phanect

Description

@phanect

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions