diff options
| author | 2025-04-04 15:34:38 +0000 | |
|---|---|---|
| committer | 2025-04-04 17:34:38 +0200 | |
| commit | db4b85715966ee590c6cdff5cc52e592b66e3d17 (patch) | |
| tree | 83642d3afe51fbe279e36a9a6c9069f785a0adeb /vendor/github.com/ncruces/go-sqlite3/error.go | |
| parent | [bugfix] Fix Atkinson Hyperlegible font embedding on Ecks Pee theme. (#3964) (diff) | |
| download | gotosocial-db4b85715966ee590c6cdff5cc52e592b66e3d17.tar.xz | |
[chore] bump ncruces/go-sqlite3 to v0.25.0 (#3966)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/error.go')
| -rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/error.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/error.go b/vendor/github.com/ncruces/go-sqlite3/error.go index 6d4bd63f8..59982eafd 100644 --- a/vendor/github.com/ncruces/go-sqlite3/error.go +++ b/vendor/github.com/ncruces/go-sqlite3/error.go @@ -2,7 +2,6 @@ package sqlite3 import ( "errors" - "strconv" "strings" "github.com/ncruces/go-sqlite3/internal/util" @@ -12,7 +11,6 @@ import ( // // https://sqlite.org/c3ref/errcode.html type Error struct { - str string msg string sql string code res_t @@ -29,19 +27,13 @@ func (e *Error) Code() ErrorCode { // // https://sqlite.org/rescode.html func (e *Error) ExtendedCode() ExtendedErrorCode { - return ExtendedErrorCode(e.code) + return xErrorCode(e.code) } // Error implements the error interface. func (e *Error) Error() string { var b strings.Builder - b.WriteString("sqlite3: ") - - if e.str != "" { - b.WriteString(e.str) - } else { - b.WriteString(strconv.Itoa(int(e.code))) - } + b.WriteString(util.ErrorCodeString(uint32(e.code))) if e.msg != "" { b.WriteString(": ") @@ -103,12 +95,12 @@ func (e ErrorCode) Error() string { // Temporary returns true for [BUSY] errors. func (e ErrorCode) Temporary() bool { - return e == BUSY + return e == BUSY || e == INTERRUPT } // ExtendedCode returns the extended error code for this error. func (e ErrorCode) ExtendedCode() ExtendedErrorCode { - return ExtendedErrorCode(e) + return xErrorCode(e) } // Error implements the error interface. @@ -133,7 +125,7 @@ func (e ExtendedErrorCode) As(err any) bool { // Temporary returns true for [BUSY] errors. func (e ExtendedErrorCode) Temporary() bool { - return ErrorCode(e) == BUSY + return ErrorCode(e) == BUSY || ErrorCode(e) == INTERRUPT } // Timeout returns true for [BUSY_TIMEOUT] errors. |
