From a3da7791904a87d42f1b74165649f4f4e446ed9e Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 12 Apr 2017 18:45:52 +0100 Subject: [PATCH] Improve SQL error messages --- sql/exprs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/exprs.go b/sql/exprs.go index 1f5c81bc..9479f8ae 100644 --- a/sql/exprs.go +++ b/sql/exprs.go @@ -100,7 +100,7 @@ func (p *parser) parseTable() (*Table, error) { _, lit, err := p.shouldBe(IDENT) if err != nil { - return nil, &ParseError{Found: lit, Expected: []string{"name"}} + return nil, &ParseError{Found: lit, Expected: []string{"table"}} } val, err := p.declare(TABLE, lit) @@ -134,7 +134,7 @@ func (p *parser) parseThing() (*Thing, error) { _, lit, err := p.shouldBe(THING) if err != nil { - return nil, &ParseError{Found: lit, Expected: []string{"record id"}} + return nil, &ParseError{Found: lit, Expected: []string{"thing"}} } val, err := p.declare(THING, lit) @@ -168,7 +168,7 @@ func (p *parser) parseIdiom() (*Ident, error) { _, lit, err := p.shouldBe(IDENT, EXPR) if err != nil { - return nil, &ParseError{Found: lit, Expected: []string{"name"}} + return nil, &ParseError{Found: lit, Expected: []string{"name, or expression"}} } val, err := p.declare(IDENT, lit) @@ -321,7 +321,7 @@ func (p *parser) parseScript() (string, error) { _, lit, err := p.shouldBe(STRING, REGION) if err != nil { - return string(""), &ParseError{Found: lit, Expected: []string{"js/lua script"}} + return string(""), &ParseError{Found: lit, Expected: []string{"script"}} } return lit, err