Skip to content

Commit 77ba360

Browse files
authored
[#193]: update frame validation error to current version
2 parents fd36dce + c136d3e commit 77ba360

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/receive.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
// shortland for the Could not open input file: ../roadrunner/tests/psr-wfsdorker.php
1414
var res = []byte("Could not op") //nolint:gochecknoglobals
1515

16+
const validationError = "validation failed on the message sent to STDOUT, see: https://roadrunner.dev/docs/known-issues-stdout-crc/current/en, invalid message: %s"
17+
1618
func ReceiveFrame(relay io.Reader, fr *frame.Frame) error {
1719
const op = errors.Op("goridge_frame_receive")
1820

@@ -58,17 +60,17 @@ func ReceiveFrame(relay io.Reader, fr *frame.Frame) error {
5860
if d, ok := relay.(deadliner); ok {
5961
err = d.SetReadDeadline(time.Now().Add(time.Second * 2))
6062
if err != nil {
61-
return errors.E(op, errors.Errorf("validation failed on the message sent to STDOUT, see: https://roadrunner.dev/docs/known-issues-stdout-crc/2.x/en, invalid message: %s", fr.Header()))
63+
return errors.E(op, errors.Errorf(validationError, fr.Header()))
6264
}
6365

6466
// we don't care about error here
6567
resp, _ := io.ReadAll(relay)
6668

67-
return errors.E(op, errors.Errorf("validation failed on the message sent to STDOUT, see: https://roadrunner.dev/docs/known-issues-stdout-crc/2.x/en, invalid message: %s", string(fr.Header())+string(resp)))
69+
return errors.E(op, errors.Errorf(validationError, string(fr.Header())+string(resp)))
6870
}
6971

7072
// no deadline, so, only 14 bytes
71-
return errors.E(op, errors.Errorf("validation failed on the message sent to STDOUT, see: https://roadrunner.dev/docs/known-issues-stdout-crc/2.x/en, invalid message: %s", fr.Header()))
73+
return errors.E(op, errors.Errorf(validationError, fr.Header()))
7274
}
7375

7476
// read the read payload

0 commit comments

Comments
 (0)