Merge pull request #18 from d2g/patch-2
Update Error Messages and Remove unused constant.
This commit is contained in:
commit
c965d5c21b
1 changed files with 23 additions and 6 deletions
29
unqlite.go
29
unqlite.go
|
@ -26,13 +26,30 @@ func (e UnQLiteError) Error() string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
// UnQLiteNoMemErr ...
|
|
||||||
UnQLiteNoMemErr UnQLiteError = UnQLiteError(C.UNQLITE_NOMEM)
|
|
||||||
)
|
|
||||||
|
|
||||||
var errString = map[UnQLiteError]string{
|
var errString = map[UnQLiteError]string{
|
||||||
C.UNQLITE_NOMEM: "Out of memory",
|
C.UNQLITE_LOCKERR: "Locking protocol error",
|
||||||
|
C.UNQLITE_READ_ONLY: "Read only Key/Value storage engine",
|
||||||
|
C.UNQLITE_CANTOPEN: "Unable to open the database file",
|
||||||
|
C.UNQLITE_FULL: "Full database",
|
||||||
|
C.UNQLITE_VM_ERR: "Virtual machine error",
|
||||||
|
C.UNQLITE_COMPILE_ERR: "Compilation error",
|
||||||
|
C.UNQLITE_DONE: "Operation done", // Not an error.
|
||||||
|
C.UNQLITE_CORRUPT: "Corrupt pointer",
|
||||||
|
C.UNQLITE_NOOP: "No such method",
|
||||||
|
C.UNQLITE_PERM: "Permission error",
|
||||||
|
C.UNQLITE_EOF: "End Of Input",
|
||||||
|
C.UNQLITE_NOTIMPLEMENTED: "Method not implemented by the underlying Key/Value storage engine",
|
||||||
|
C.UNQLITE_BUSY: "The database file is locked",
|
||||||
|
C.UNQLITE_UNKNOWN: "Unknown configuration option",
|
||||||
|
C.UNQLITE_EXISTS: "Record exists",
|
||||||
|
C.UNQLITE_ABORT: "Another thread have released this instance",
|
||||||
|
C.UNQLITE_INVALID: "Invalid parameter",
|
||||||
|
C.UNQLITE_LIMIT: "Database limit reached",
|
||||||
|
C.UNQLITE_NOTFOUND: "No such record",
|
||||||
|
C.UNQLITE_LOCKED: "Forbidden Operation",
|
||||||
|
C.UNQLITE_EMPTY: "Empty record",
|
||||||
|
C.UNQLITE_IOERR: "IO error",
|
||||||
|
C.UNQLITE_NOMEM: "Out of memory",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Database ...
|
// Database ...
|
||||||
|
|
Loading…
Reference in a new issue