2019-07-02 22:03:23 +02:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2020-01-23 10:10:32 +01:00
|
|
|
"net/http"
|
|
|
|
|
2019-07-02 22:03:23 +02:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
2020-01-12 14:00:56 +01:00
|
|
|
"github.com/photoprism/photoprism/pkg/txt"
|
2019-07-02 22:03:23 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-03-31 17:26:25 +02:00
|
|
|
ErrUnauthorized = gin.H{"code": http.StatusUnauthorized, "error": txt.UcFirst(config.ErrUnauthorized.Error())}
|
|
|
|
ErrReadOnly = gin.H{"code": http.StatusForbidden, "error": txt.UcFirst(config.ErrReadOnly.Error())}
|
|
|
|
ErrUploadNSFW = gin.H{"code": http.StatusForbidden, "error": txt.UcFirst(config.ErrUploadNSFW.Error())}
|
|
|
|
ErrAccountNotFound = gin.H{"code": http.StatusNotFound, "error": "Account not found"}
|
|
|
|
ErrConnectionFailed = gin.H{"code": http.StatusConflict, "error": "Failed to connect"}
|
|
|
|
ErrAlbumNotFound = gin.H{"code": http.StatusNotFound, "error": "Album not found"}
|
|
|
|
ErrPhotoNotFound = gin.H{"code": http.StatusNotFound, "error": "Photo not found"}
|
|
|
|
ErrLabelNotFound = gin.H{"code": http.StatusNotFound, "error": "Label not found"}
|
2020-05-04 17:11:53 +02:00
|
|
|
ErrFileNotFound = gin.H{"code": http.StatusNotFound, "error": "File not found"}
|
2020-03-31 17:26:25 +02:00
|
|
|
ErrUnexpectedError = gin.H{"code": http.StatusInternalServerError, "error": "Unexpected error"}
|
2020-04-20 10:38:01 +02:00
|
|
|
ErrSaveFailed = gin.H{"code": http.StatusInternalServerError, "error": "Changes could not be saved"}
|
|
|
|
ErrFormInvalid = gin.H{"code": http.StatusBadRequest, "error": "Changes could not be saved"}
|
|
|
|
ErrFeatureDisabled = gin.H{"code": http.StatusForbidden, "error": "Feature disabled"}
|
2019-07-02 22:03:23 +02:00
|
|
|
)
|