summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-20 14:53:12 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-20 14:53:12 -0600
commitd74e2f3e1146efd80d4eeee36cf5c53e68b31fcc (patch)
tree80f5bcefbf4a481d6c841ff9ae333500ed143d88 /model
parente70428c1bdb335f691a7740d15ed845f07670909 (diff)
downloadchat-d74e2f3e1146efd80d4eeee36cf5c53e68b31fcc.tar.gz
chat-d74e2f3e1146efd80d4eeee36cf5c53e68b31fcc.tar.bz2
chat-d74e2f3e1146efd80d4eeee36cf5c53e68b31fcc.zip
tweaking
Diffstat (limited to 'model')
-rw-r--r--model/utils.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/model/utils.go b/model/utils.go
index 0d26fd3ba..a18ca760e 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -25,9 +25,8 @@ type StringMap map[string]string
type StringArray []string
type EncryptStringMap map[string]string
-// AppError is returned for any http response that's not in the 200 range.
type AppError struct {
- LocId string `json:"loc_id"` // Message to be display to the end user without debugging information
+ Id string `json:"id"`
Message string `json:"message"` // Message to be display to the end user without debugging information
DetailedError string `json:"detailed_error"` // Internal error string to help the developer
RequestId string `json:"request_id"` // The RequestId that's also set in the header
@@ -44,9 +43,9 @@ func (er *AppError) Error() string {
func (er *AppError) Translate(T goi18n.TranslateFunc) {
if len(er.Message) == 0 {
if er.params == nil {
- er.Message = T(er.LocId)
+ er.Message = T(er.Id)
} else {
- er.Message = T(er.LocId, er.params)
+ er.Message = T(er.Id, er.params)
}
}
}
@@ -82,9 +81,9 @@ func NewAppError(where string, message string, details string) *AppError {
return ap
}
-func NewLocAppError(where string, locId string, params map[string]interface{}, details string) *AppError {
+func NewLocAppError(where string, id string, params map[string]interface{}, details string) *AppError {
ap := &AppError{}
- ap.LocId = locId
+ ap.Id = id
ap.params = params
ap.Where = where
ap.DetailedError = details