Code formatting and cleanup (#442)

* Formatting, extract error messages
* More refactor
* Move errors to a separate file
* Add missing file
* Misc
This commit is contained in:
Dan Sosedoff
2019-09-29 12:16:42 -05:00
committed by GitHub
parent c4db1973c4
commit 7a6450091a
6 changed files with 109 additions and 66 deletions

19
pkg/api/errors.go Normal file
View File

@@ -0,0 +1,19 @@
package api
import (
"errors"
)
var (
errNotConnected = errors.New("Not connected")
errNotPermitted = errors.New("Not permitted")
errConnStringRequired = errors.New("Connection string is required")
errInvalidConnString = errors.New("Invalid connection string")
errSessionRequired = errors.New("Session ID is required")
errSessionLocked = errors.New("Session is locked")
errURLRequired = errors.New("URL parameter is required")
errQueryRequired = errors.New("Query parameter is required")
errDatabaseNameRequired = errors.New("Database name is required")
errPgDumpNotFound = errors.New("pg_dump utility is not found")
errBackendConnectError = errors.New("Unable to connect to the auth backend")
)