Skip to main content

decode_failure

Function decode_failure 

Source
pub fn decode_failure(subject: &str, err: &DecodeError, limit: usize) -> String
Expand description

Describe a failure to decode a descriptor set, naming the override when the element-memory bound is what rejected it.

subject is the message being decoded, e.g. "CodeGeneratorRequest". limit is the bound that was actually in force, which is not TOOLING_ELEMENT_MEMORY_LIMIT once the environment overrides it — read it back with DecodeOptions::element_memory_limit.

The bare error text names no remedy, and whoever hits the bound is exactly who needs ELEMENT_MEMORY_LIMIT_ENV — so the hint belongs on the message they see, not only in the guide.