summaryrefslogtreecommitdiffstats
path: root/model/cluster_discovery.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-09-15 13:32:11 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-09-15 08:32:11 -0400
commit2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d (patch)
tree513dee966bfa8d3810ddf631df90270acd342e4f /model/cluster_discovery.go
parent600beb5af3e35fd82a2b06995b67629d08fe0fe3 (diff)
downloadchat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.tar.gz
chat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.tar.bz2
chat-2be5577b88e5ff85a98b0a2b3e3a43b90cc99c6d.zip
Model: NewLocAppError -> NewAppError (#7450)
Diffstat (limited to 'model/cluster_discovery.go')
-rw-r--r--model/cluster_discovery.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/model/cluster_discovery.go b/model/cluster_discovery.go
index 4b9269656..89e5fc95e 100644
--- a/model/cluster_discovery.go
+++ b/model/cluster_discovery.go
@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
+ "net/http"
"os"
)
@@ -85,27 +86,27 @@ func FilterClusterDiscovery(vs []*ClusterDiscovery, f func(*ClusterDiscovery) bo
func (o *ClusterDiscovery) IsValid() *AppError {
if len(o.Id) != 26 {
- return NewLocAppError("Channel.IsValid", "model.channel.is_valid.id.app_error", nil, "")
+ return NewAppError("Channel.IsValid", "model.channel.is_valid.id.app_error", nil, "", http.StatusBadRequest)
}
if len(o.ClusterName) == 0 {
- return NewLocAppError("ClusterDiscovery.IsValid", "ClusterName must be set", nil, "")
+ return NewAppError("ClusterDiscovery.IsValid", "ClusterName must be set", nil, "", http.StatusBadRequest)
}
if len(o.Type) == 0 {
- return NewLocAppError("ClusterDiscovery.IsValid", "Type must be set", nil, "")
+ return NewAppError("ClusterDiscovery.IsValid", "Type must be set", nil, "", http.StatusBadRequest)
}
if len(o.Hostname) == 0 {
- return NewLocAppError("ClusterDiscovery.IsValid", "Hostname must be set", nil, "")
+ return NewAppError("ClusterDiscovery.IsValid", "Hostname must be set", nil, "", http.StatusBadRequest)
}
if o.CreateAt == 0 {
- return NewLocAppError("ClusterDiscovery.IsValid", "CreateAt must be set", nil, "")
+ return NewAppError("ClusterDiscovery.IsValid", "CreateAt must be set", nil, "", http.StatusBadRequest)
}
if o.LastPingAt == 0 {
- return NewLocAppError("ClusterDiscovery.IsValid", "LastPingAt must be set", nil, "")
+ return NewAppError("ClusterDiscovery.IsValid", "LastPingAt must be set", nil, "", http.StatusBadRequest)
}
return nil