Skip to main content

CaError

Enum CaError 

Source
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_actionECA_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 (dbPutLinkdbDbPutValue) 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.

Fields

§line: usize
§token: String
§message: String
§

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

Source

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 Debug for CaError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CaError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CaError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CaError> for AutosaveError

Source§

fn from(e: CaError) -> Self

Converts to this type from the input type.
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.

Source§

fn from(e: CaError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for CaError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<IocRunFailure> for CaError

Source§

fn from(failure: IocRunFailure) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more