mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: store/db
module with sqlite
This commit is contained in:
19
store/error.go
Normal file
19
store/error.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
)
|
||||
|
||||
func FormatError(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch err {
|
||||
case sql.ErrNoRows:
|
||||
return errors.New("data not found")
|
||||
default:
|
||||
return err
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user