Commit d90dd8b9 authored by Kirill Smelkov's avatar Kirill Smelkov

fixup! open: Fix error message

This commit fixes 0d47edb6. Recently I hit the following: I was trying
to open the database via

	sqlite3.Open(dburl, sqlite3.OpenNoMutex)

i.e. by passing flags, but erroneously no OpenReadWrite or something
similar, and got

	"testdata/1.sqlite: bad parameter or other API misuse"

as the error.

The message was confusing because there is no "open" action in it, so
add the action to OpenError and the mesage becomes:

	"testdata/1.sqlite: open: bad parameter or other API misuse"

See full discussion for structure of error messages here:

https://github.com/gwenn/gosqlite/pull/14
parent 900751f4
...@@ -44,7 +44,7 @@ func (e OpenError) Error() string { ...@@ -44,7 +44,7 @@ func (e OpenError) Error() string {
if file == "" { if file == "" {
file = "(temporary)" file = "(temporary)"
} }
s := fmt.Sprintf("%s: ", file) s := fmt.Sprintf("%s: open: ", file)
codeErr := e.Code.Error() codeErr := e.Code.Error()
if len(e.Msg) > 0 { if len(e.Msg) > 0 {
s += e.Msg s += e.Msg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment