73 return "file not found";
75 return "buffer too small";
77 return "packet number mismatch";
118 std::string_view filename) {
120 std::format(
"{} slave {} '{}' failed ({})", op, slave, filename,
foeReason(kind))};
Definition al_status_codes.cc:5
std::string_view foeReason(FoeErrorKind kind)
Short human-readable reason for a FoE kind (no surrounding punctuation).
Definition foe_error.h:68
FoeErrorKind
Specific File-over-EtherCAT failure kind. Transport-agnostic: a SOEM driver decodes it from a negated...
Definition foe_error.h:59
@ NoResponse
The slave answered nothing (work counter 0 — timeout or not ready).
@ FileNotFound
Firmware recognises no such filename.
@ PacketMismatch
Packet-number desync mid-transfer.
@ Protocol
Generic FoE-protocol error with no finer classification.
@ BufferTooSmall
The slave's buffer cannot hold the requested transfer.
Retry foeRetry(FoeErrorKind kind)
Retry disposition implied by a FoE kind. A missing file or an undersized buffer is a fixed condition ...
Definition foe_error.h:87
FoeError makeFoeError(FoeErrorKind kind, std::string_view op, uint16_t slave, std::string_view filename)
Builds a fully-formed FoeError from a decoded kind plus call context. Keeps the message wording ident...
Definition foe_error.h:117
std::ostream & operator<<(std::ostream &os, const FoeError &e)
Streams the message, so ASSERT_TRUE(r) << r.error() and spdlog {} work unchanged.
Definition foe_error.h:112
Retry
Retry disposition of a failed operation: whether re-issuing the identical call could plausibly succee...
Definition foe_error.h:52
@ Permanent
The identical call will fail the same way (no such file, undersized buffer).
@ Transient
A fresh attempt may succeed (protocol desync, slave not yet ready after BOOT).
A structured FoE failure. String-like where a caller only forwards it (operator<<,...
Definition foe_error.h:102
std::string message
Definition foe_error.h:105
Retry retry
Definition foe_error.h:104
FoeErrorKind kind
Definition foe_error.h:103
const std::string & what() const
Exception-shaped accessor for the message, for call sites that prefer .what().
Definition foe_error.h:108