示例#1
0
func (e Errno) Error() string {
	var s string
	if e == ErrSpecific {
		s = "Wrapper specific error"
	} else {
		s = C.GoString(C.sqlite3_errstr(C.int(e)))
	}
	if s == "" {
		return fmt.Sprintf("errno %d", int(e))
	}
	return s
}
示例#2
0
func errorString(err Error) string {
	return C.GoString(C.sqlite3_errstr(C.int(err.Code)))
}
示例#3
0
文件: util.go 项目: gidden/cloudlus
// libErr reports an error originating in SQLite. The error message is obtained
// from the database connection when possible, which may include some additional
// information. Otherwise, the result code is translated to a generic message.
func libErr(rc C.int, db *C.sqlite3) error {
	if db != nil && rc == C.sqlite3_errcode(db) {
		return &Error{int(rc), C.GoString(C.sqlite3_errmsg(db))}
	}
	return &Error{int(rc), C.GoString(C.sqlite3_errstr(rc))}
}
示例#4
0
func errorString(err ErrNo) string {
	return C.GoString(C.sqlite3_errstr(C.int(err)))
}