Add data layer
This includes config changes, collections, posts, some post rendering funcs, and actual database connection when the server starts up.
This commit is contained in:
21
errors.go
21
errors.go
@@ -7,5 +7,24 @@ import (
|
||||
|
||||
// Commonly returned HTTP errors
|
||||
var (
|
||||
ErrInternalCookieSession = impart.HTTPError{http.StatusInternalServerError, "Could not get cookie session."}
|
||||
ErrBadAccessToken = impart.HTTPError{http.StatusUnauthorized, "Invalid access token."}
|
||||
ErrNoAccessToken = impart.HTTPError{http.StatusBadRequest, "Authorization token required."}
|
||||
|
||||
ErrForbiddenCollection = impart.HTTPError{http.StatusForbidden, "You don't have permission to add to this collection."}
|
||||
ErrUnauthorizedEditPost = impart.HTTPError{http.StatusUnauthorized, "Invalid editing credentials."}
|
||||
ErrUnauthorizedGeneral = impart.HTTPError{http.StatusUnauthorized, "You don't have permission to do that."}
|
||||
|
||||
ErrInternalGeneral = impart.HTTPError{http.StatusInternalServerError, "The humans messed something up. They've been notified."}
|
||||
|
||||
ErrCollectionPageNotFound = impart.HTTPError{http.StatusNotFound, "Collection page doesn't exist."}
|
||||
ErrPostNotFound = impart.HTTPError{Status: http.StatusNotFound, Message: "Post not found."}
|
||||
ErrPostUnpublished = impart.HTTPError{Status: http.StatusGone, Message: "Post unpublished by author."}
|
||||
ErrPostFetchError = impart.HTTPError{Status: http.StatusInternalServerError, Message: "We encountered an error getting the post. The humans have been alerted."}
|
||||
|
||||
ErrUserNotFound = impart.HTTPError{http.StatusNotFound, "User doesn't exist."}
|
||||
)
|
||||
|
||||
// Post operation errors
|
||||
var (
|
||||
ErrPostNoUpdatableVals = impart.HTTPError{http.StatusBadRequest, "Supply some properties to update."}
|
||||
)
|
||||
|
Reference in New Issue
Block a user