pub fn build_error_envelope( err: &(dyn Error + 'static), system: &str, ) -> Envelope
Builds an error envelope, preserving structured details from known error types.