pub fn error_with_data<T: Serialize>( message: String, data: &T, ) -> Result<(), String>
Logs an error message with additional serialized data.