Skip to content

Commit d18f8eb

Browse files
committed
Use go-errors.v1 throw all the project and reorganize them in sql/core.go
Signed-off-by: Manuel Carmona <manu.carmona90@gmail.com>
1 parent b4c3bf9 commit d18f8eb

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

sql/core.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ import (
66
"gopkg.in/src-d/go-errors.v1"
77
)
88

9+
var (
10+
// ErrInvalidType is thrown when there is an unexpected type at some part of
11+
// the execution tree.
12+
ErrInvalidType = errors.NewKind("invalid type: %s")
13+
14+
// ErrTableAlreadyExists is thrown when someone tries to create a
15+
// table with a name of an existing one
16+
ErrTableAlreadyExists = errors.NewKind("table with name %s already exists")
17+
18+
// ErrTableNotFound is returned when the table is not available from the
19+
// current scope.
20+
ErrTableNotFound = errors.NewKind("table not found: %s")
21+
22+
//ErrUnexpectedRowLength is thrown when the obtained row has more columns than the schema
23+
ErrUnexpectedRowLength = errors.NewKind("expected %d values, got %d")
24+
)
25+
926
// Nameable is something that has a name.
1027
type Nameable interface {
1128
// Name returns the name.
@@ -141,18 +158,3 @@ type Database interface {
141158
type Alterable interface {
142159
Create(name string, schema Schema) error
143160
}
144-
145-
// ErrInvalidType is thrown when there is an unexpected type at some part of
146-
// the execution tree.
147-
var ErrInvalidType = errors.NewKind("invalid type: %s")
148-
149-
// ErrTableAlreadyExists is thrown when someone tries to create a
150-
// table with a name of an existing one
151-
var ErrTableAlreadyExists = errors.NewKind("table with name %s already exists")
152-
153-
// ErrTableNotFound is returned when the table is not available from the
154-
// current scope.
155-
var ErrTableNotFound = errors.NewKind("table not found: %s")
156-
157-
//ErrUnexpectedRowLength is thrown when the obtained row has more columns than the schema
158-
var ErrUnexpectedRowLength = errors.NewKind("expected %d values, got %d")

sql/expression/function/concat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
errors "gopkg.in/src-d/go-errors.v0"
7+
errors "gopkg.in/src-d/go-errors.v1"
88
"gopkg.in/src-d/go-mysql-server.v0/sql"
99
)
1010

0 commit comments

Comments
 (0)