From d74e2f3e1146efd80d4eeee36cf5c53e68b31fcc Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Wed, 20 Jan 2016 14:53:12 -0600 Subject: tweaking --- model/utils.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'model/utils.go') 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 -- cgit v1.2.3-1-g7c22