Skip to main content

encode_protocol_error_response

Function encode_protocol_error_response 

Source
pub fn encode_protocol_error_response(
    interaction: ProtocolInteraction,
    error: &ProtocolError,
    limits: Limits,
) -> Result<Response<Vec<u8>>, EncodeHttpError>
Expand description

Encodes a canonical Host error envelope using its standard HTTP status.

The code must be allowed for interaction. This API accepts only ProtocolError, so client-local InvalidResponse and UnsupportedDescriptorFormat classifications cannot be emitted as Host error envelopes. Logical resource_limit_exceeded failures use HTTP 422; representation and deployment limits are not protocol errors.