pub enum CaError {
Show 24 variants
Io(Error),
Timeout,
ChannelNotFound(String),
Protocol(String),
UnsupportedType(u16),
WriteFailed(u32),
FieldNotFound(String),
ReadOnlyField(String),
TypeMismatch(String),
InvalidValue(String),
BadField(String),
BadChoice(String),
BadDbrType(String),
PutDisabled(String),
LinkError(String),
DbParseError {
line: usize,
token: String,
message: String,
},
DbLoadFailed(String),
CalcError(String),
Disconnected,
Shutdown,
ServerError(u32),
TooLarge,
BadCount,
GetConvertFailed(String),
}Variants§
Io(Error)
Timeout
ChannelNotFound(String)
Protocol(String)
UnsupportedType(u16)
WriteFailed(u32)
FieldNotFound(String)
ReadOnlyField(String)
TypeMismatch(String)
InvalidValue(String)
BadField(String)
C S_db_badField (“Illegal RECORD FIELD”) — a record’s special()
refused the value that dbPut had already stored, e.g.
calcRecord.c:146-152 returning it for an uncompilable CALC. The
value stays written, the field’s monitor is not posted, the record is
not processed, and the status propagates to the client (rsrv
write_action → ECA_PUTFAIL).
BadChoice(String)
C S_db_badChoice (“Illegal choice”) — a DBR_STRING write to a
DBF_MENU field named neither an exact choice label nor an in-range
index (dbConvert.c::putStringMenu:1216-1229). C’s converter returns
this from inside dbPut, before the value is stored
(dbAccess.c:1362), so the field keeps its old value, no monitor is
posted and the record is not processed.
BadDbrType(String)
C S_db_badDbrtype (“Illegal Database Request Type”) — dbPut
refusing a put to a DBF link field (field_type > DBF_DEVICE,
dbAccess.c:1340-1347). Only dbPutField changes link fields, by
routing them through dbPutFieldLink (dbAccess.c:1261-1262); a
dbPut reached from a record’s OUT link (dbPutLink →
dbDbPutValue) or from internal code refuses, so a DB link cannot
silently rewire another record’s link field. rsrv answers it with
ECA_PUTFAIL like every non-zero put status — and with ECA_GETFAIL when
the same refusal comes back from a get, which is why
CaError::to_eca_status takes the direction.
PutDisabled(String)
LinkError(String)
DbParseError
A .db/.dbd parse abort, carried as C yyerror prints it
(dbYacc.y:370-383): the line, the sentence, and yytext — the token
the lexer had matched when the parser rejected it, which is what C
quotes in its at or before '%s' clause. An empty token is a
failure raised where no token was matched, and prints no such clause.
DbLoadFailed(String)
C dbLoadRecords returning non-zero after yyerror(NULL)
recovered from a bad item (dbAccess.c:795-813). The records
that parsed are still there; the load’s status is the failure,
and softMain exits 2 on it (softMain.cpp:198,274-278).
CalcError(String)
Disconnected
Shutdown
ServerError(u32)
Server-emitted ECA status carried out-of-band on an otherwise
data-shaped frame — used by libca cac::eventAddRespAction
(cac.cpp:973-977) when a monitor frame’s m_cid is non-
NORMAL (e.g. ECA_NORDACCESS from no_read_access_event
after an ACF reload). Routed to the per-subscription
callback as Err(CaError::ServerError(eca_status)) so the
subscriber surfaces the status instead of seeing the bogus
zeroed payload that travels with the frame.
TooLarge
Request cannot be framed for the peer: it needs the extended
(24-byte) CA header, and the peer’s protocol version predates
CA_V49, or the element count exceeds what the peer can carry.
libca raises this locally — comQueSend::insertRequestHeader
throws cacChannel::outOfBounds() (comQueSend.cpp:299,313)
and ca_array_get/ca_array_put return ECA_TOLARGE — so no
byte reaches the wire.
BadCount
Element count out of bounds for the request C would build. libca’s
put path throws cacChannel::outOfBounds() for an array that cannot
fit the peer’s message-body limit (comQueSend.cpp:361) or that
needs an extended header the peer cannot parse
(comQueSend.cpp:313); oldChannelNotify.cpp:309,378,453 map that
to ECA_BADCOUNT. Raised locally — no byte reaches the wire.
GetConvertFailed(String)
A get conversion returned a non-zero status: C
dbGetConvertRoutine/dbFastGetConvertRoutine refusing to render a
field in the requested DBR type, which for the DBF_STRING row means
epicsParse* rejecting the stored text (cvt_st_d,
dbFastLinkConv.c:233-244). dbChannel_get turns it into -1
(db_access.c:816) and rsrv answers the read with a ZEROED payload and
m_cid = ECA_GETFAIL (camessage.c:545-561) rather than a value.
Distinct from Self::InvalidValue, which the put direction raises and
rsrv answers ECA_PUTFAIL.
Implementations§
Source§impl CaError
impl CaError
Sourcepub fn to_eca_status(&self, op: CaOp) -> u32
pub fn to_eca_status(&self, op: CaOp) -> u32
The ECA status a CA CLIENT reports for this error on op.
Layered as C’s read_action/write_action are. A status the error
already carries, or that a gate ABOVE the database produced, is the
same word whichever way the request was going; everything the database
itself refused is decided by op alone, because that is the point at
which C stops looking at the status.
This is the client-side table, which sees libca’s local statuses too.
The server’s reply table is PutStatus::of_failure
(epics-ca-rs/src/server/tcp.rs) and is deliberately narrower: by the
time rsrv reaches dbChannel_put, the gates above it have already
answered, so every error left there is a database refusal.
Trait Implementations§
Source§impl Error for CaError
impl Error for CaError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<CaError> for AutosaveError
impl From<CaError> for AutosaveError
Source§impl From<CaError> for IocRunFailure
The lifecycle’s default phase: every ? inside it is a boot step, which
is why only the two exceptions are written out by hand.
impl From<CaError> for IocRunFailure
The lifecycle’s default phase: every ? inside it is a boot step, which
is why only the two exceptions are written out by hand.