aboutsummaryrefslogtreecommitdiff
path: root/errors.go
diff options
context:
space:
mode:
Diffstat (limited to 'errors.go')
-rw-r--r--errors.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/errors.go b/errors.go
index 989561a..faf009c 100644
--- a/errors.go
+++ b/errors.go
@@ -12,6 +12,29 @@ import (
libhttp "github.com/shuLhan/share/lib/http"
)
+func errAttackConflict(ltr *loadTestingResult) error {
+ res := &libhttp.EndpointResponse{
+ E: liberrors.E{
+ Code: http.StatusConflict,
+ Message: "another attack is already running",
+ Name: "ERR_ATTACK_CONFLICT",
+ },
+ Data: ltr,
+ }
+ return res
+}
+
+func errAttackNotAllowed() error {
+ res := &libhttp.EndpointResponse{
+ E: liberrors.E{
+ Code: http.StatusNotAcceptable,
+ Message: "attack is not allowed",
+ Name: "ERR_ATTACK_NOT_ALLOWED",
+ },
+ }
+ return res
+}
+
func errInternal(err error) error {
res := &libhttp.EndpointResponse{
E: liberrors.E{