()
| 14 | type startWriteError struct{ code, holder, reason string } |
| 15 | |
| 16 | func (e *startWriteError) Error() string { |
| 17 | if e.code == "start_owner_only" { |
| 18 | switch e.reason { |
| 19 | case "activation": |
| 20 | return "Only workspace owners may make a start playbook active" |
| 21 | case "condition": |
| 22 | return "Only workspace owners may change the start condition of a start playbook" |
| 23 | } |
| 24 | return "Only workspace owners may set, change or clear start or change the role of a start playbook" |
| 25 | } |
| 26 | return fmt.Sprintf("clear start on %s first", e.holder) |
| 27 | } |
| 28 | func writeStartError(w http.ResponseWriter, err error) bool { |
| 29 | var e *startWriteError |
| 30 | if !errors.As(err, &e) { |
no outgoing calls
no test coverage detected