summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-30 08:30:02 -0500
committerGitHub <noreply@github.com>2017-01-30 08:30:02 -0500
commitc01d9ad6cf3f8bb2ad4145441816598d8ffa2d9e (patch)
treef995a08e296b5088df2a882ab70251c7b2b8cfe7 /model/utils.go
parent3e2f879b77b9b9d089bc8f83304b8b21b83c5bd9 (diff)
downloadchat-c01d9ad6cf3f8bb2ad4145441816598d8ffa2d9e.tar.gz
chat-c01d9ad6cf3f8bb2ad4145441816598d8ffa2d9e.tar.bz2
chat-c01d9ad6cf3f8bb2ad4145441816598d8ffa2d9e.zip
Implement APIv4 infrastructure (#5191)
* Implement APIv4 infrastructure * Update parameter requirement functions per feedback
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/model/utils.go b/model/utils.go
index 0ce243fe7..05143b20d 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -93,6 +93,18 @@ func AppErrorFromJson(data io.Reader) *AppError {
}
}
+func NewAppError(where string, id string, params map[string]interface{}, details string, status int) *AppError {
+ ap := &AppError{}
+ ap.Id = id
+ ap.params = params
+ ap.Message = id
+ ap.Where = where
+ ap.DetailedError = details
+ ap.StatusCode = status
+ ap.IsOAuth = false
+ return ap
+}
+
func NewLocAppError(where string, id string, params map[string]interface{}, details string) *AppError {
ap := &AppError{}
ap.Id = id