Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10493234
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/errors/general.go b/errors/general.go
new file mode 100644
index 0000000..2320575
--- /dev/null
+++ b/errors/general.go
@@ -0,0 +1,29 @@
+package errors
+
+import (
+ "github.com/writeas/impart"
+ "net/http"
+)
+
+var (
+ // Commonly returned HTTP errors
+ ErrBadFormData = impart.HTTPError{http.StatusBadRequest, "Expected valid form data."}
+ ErrBadJSON = impart.HTTPError{http.StatusBadRequest, "Expected valid JSON object."}
+ ErrBadJSONArray = impart.HTTPError{http.StatusBadRequest, "Expected valid JSON array."}
+ ErrBadAccessToken = impart.HTTPError{http.StatusUnauthorized, "Invalid access token."}
+ ErrNoAccessToken = impart.HTTPError{http.StatusBadRequest, "Authorization token required."}
+ ErrNotLoggedIn = impart.HTTPError{http.StatusUnauthorized, "Not logged in."}
+ ErrBadRequestedType = impart.HTTPError{http.StatusNotAcceptable, "Bad requested Content-Type."}
+
+ // Post operation errors
+ ErrPostNoUpdatableVals = impart.HTTPError{http.StatusBadRequest, "Supply some properties to update."}
+ ErrNoPublishableContent = impart.HTTPError{http.StatusBadRequest, "Supply something to publish."}
+
+ // Internal errors
+ ErrInternalGeneral = impart.HTTPError{http.StatusInternalServerError, "The humans messed something up. They've been notified."}
+ ErrInternalCookieSession = impart.HTTPError{http.StatusInternalServerError, "Could not get cookie session."}
+
+ // User errors
+ ErrUserNotFound = impart.HTTPError{http.StatusNotFound, "User doesn't exist."}
+ ErrUserNotFoundEmail = impart.HTTPError{http.StatusNotFound, "Please enter your username instead of your email address."}
+)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Mar 5, 8:28 PM (16 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3167722
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment