Skip to main content

changes_error_from_backend

Function changes_error_from_backend 

Source
pub fn changes_error_from_backend<E: Error>(
    err: BackendChangesError<E>,
) -> JmapError
Expand description

Map a JmapBackend::get_changes error to the Foo/changes method error (RFC 8620 §5.2).

tooManyChanges is a Foo/queryChanges error only (§5.6); §5.2 lists cannotCalculateChanges as the sole changes-specific error, and a server over maxChanges that “is unable to calculate an intermediate state … MUST return a “cannotCalculateChanges” error response instead“. So BackendChangesError::TooManyChanges becomes cannotCalculateChanges here; every other variant maps as its From impl does. Every /changes handler uses this instead of JmapError::from; /queryChanges handlers keep JmapError::from.