diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-21 23:24:46 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-21 23:24:46 +0700 |
| commit | 7fed1f75a32c161ba0d296dbb7b6dc14e831336e (patch) | |
| tree | a2d4f65b11a20aefaad4738f3a02a0b908ccb1b8 /errors.go | |
| parent | 360bf84d2af244c7926c2aa7c1f23d0c280b8238 (diff) | |
| download | gorankusu-7fed1f75a32c161ba0d296dbb7b6dc14e831336e.tar.xz | |
all: implement interface and API to cancel running attack
On the top of the page, it will display currently running attack with
target name and HTTP target name. User can cancel the attack by
clicking "Cancel" button on the right.
Diffstat (limited to 'errors.go')
| -rw-r--r-- | errors.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -12,14 +12,15 @@ import ( libhttp "github.com/shuLhan/share/lib/http" ) -func errAttackConflict(ar *AttackResult) error { +func errAttackConflict(rr *RunRequest) error { res := &libhttp.EndpointResponse{ E: liberrors.E{ - Code: http.StatusConflict, - Message: "another attack is already running", - Name: "ERR_ATTACK_CONFLICT", + Code: http.StatusConflict, + Message: fmt.Sprintf(`Another attack is already running: "%s/%s`, + rr.Target.Name, rr.HttpTarget.Name), + Name: "ERR_ATTACK_CONFLICT", }, - Data: ar, + Data: rr, } return res } |
