Skip to content

Commit

Permalink
Fixed #37
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Feb 13, 2013
1 parent 9b745ee commit bfae0c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (c *SQLiteConn) Close() error {
}
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK {
return errors.New("sqlite succeeded without returning a database")
return errors.New("error while closing sqlite database connection")
}
c.db = nil
return nil
Expand Down Expand Up @@ -208,6 +208,9 @@ func (s *SQLiteStmt) Close() error {
return nil
}
s.closed = true
if s.c == nil || s.c.db == nil {
return errors.New("sqlite statement with already closed database connection")
}
rv := C.sqlite3_finalize(s.s)
if rv != C.SQLITE_OK {
return errors.New(C.GoString(C.sqlite3_errmsg(s.c.db)))
Expand Down

0 comments on commit bfae0c6

Please sign in to comment.