File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package sqliteadmin
33import (
44 "errors"
55 "fmt"
6+ "net/http"
67)
78
89var (
@@ -22,13 +23,13 @@ func (e ApiError) Error() string {
2223}
2324
2425func apiErrUnauthorized () ApiError {
25- return ApiError {StatusCode : 401 , Message : "Invalid credentials" }
26+ return ApiError {StatusCode : http . StatusUnauthorized , Message : "Invalid credentials" }
2627}
2728
2829func apiErrBadRequest (details string ) ApiError {
29- return ApiError {StatusCode : 400 , Message : "Bad request: " + details }
30+ return ApiError {StatusCode : http . StatusBadRequest , Message : "Bad request: " + details }
3031}
3132
3233func apiErrSomethingWentWrong () ApiError {
33- return ApiError {StatusCode : 500 , Message : "Something went wrong" }
34+ return ApiError {StatusCode : http . StatusInternalServerError , Message : "Something went wrong" }
3435}
You can’t perform that action at this time.
0 commit comments