@@ -96,44 +96,91 @@ typedef struct {
9696
9797/* Create a new Geneva client.
9898 - On success returns GENEVA_SUCCESS and writes *out_handle.
99- - On failure returns an error code.
99+ - On failure returns an error code and optionally writes diagnostic message to err_msg_out.
100+
101+ Parameters:
102+ - config: Configuration structure (required)
103+ - out_handle: Receives the client handle on success (required)
104+ - err_msg_out: Optional buffer to receive error message (can be NULL).
105+ Message will be NUL-terminated and truncated if buffer too small.
106+ Recommended size: >= 256 bytes for full diagnostics.
107+ - err_msg_len: Size of err_msg_out buffer in bytes (ignored if err_msg_out is NULL)
100108
101109 IMPORTANT: Caller must call geneva_client_free() on the returned handle
102110 to avoid memory leaks. All strings in config are copied; caller retains
103111 ownership of config strings and may free them after this call returns. */
104112GenevaError geneva_client_new (const GenevaConfig * config ,
105- GenevaClientHandle * * out_handle );
113+ GenevaClientHandle * * out_handle ,
114+ char * err_msg_out ,
115+ size_t err_msg_len );
106116
107117
108118/* 1) Encode and compress logs into batches (synchronous).
109119 `data` is a protobuf-encoded ExportLogsServiceRequest.
110120 - On success returns GENEVA_SUCCESS and writes *out_batches.
111- - On failure returns an error code.
121+ - On failure returns an error code and optionally writes diagnostic message to err_msg_out.
122+
123+ Parameters:
124+ - handle: Client handle from geneva_client_new (required)
125+ - data: Protobuf-encoded ExportLogsServiceRequest (required)
126+ - data_len: Length of data buffer (required)
127+ - out_batches: Receives the batches handle on success (required)
128+ - err_msg_out: Optional buffer to receive error message (can be NULL).
129+ Message will be NUL-terminated and truncated if buffer too small.
130+ Recommended size: >= 256 bytes.
131+ - err_msg_len: Size of err_msg_out buffer in bytes (ignored if err_msg_out is NULL)
132+
112133 Caller must free *out_batches with geneva_batches_free. */
113134GenevaError geneva_encode_and_compress_logs (GenevaClientHandle * handle ,
114135 const uint8_t * data ,
115136 size_t data_len ,
116- EncodedBatchesHandle * * out_batches );
137+ EncodedBatchesHandle * * out_batches ,
138+ char * err_msg_out ,
139+ size_t err_msg_len );
117140
118141/* 1.1) Encode and compress spans into batches (synchronous).
119142 `data` is a protobuf-encoded ExportTraceServiceRequest.
120143 - On success returns GENEVA_SUCCESS and writes *out_batches.
121- - On failure returns an error code.
144+ - On failure returns an error code and optionally writes diagnostic message to err_msg_out.
145+
146+ Parameters:
147+ - handle: Client handle from geneva_client_new (required)
148+ - data: Protobuf-encoded ExportTraceServiceRequest (required)
149+ - data_len: Length of data buffer (required)
150+ - out_batches: Receives the batches handle on success (required)
151+ - err_msg_out: Optional buffer to receive error message (can be NULL).
152+ Message will be NUL-terminated and truncated if buffer too small.
153+ Recommended size: >= 256 bytes.
154+ - err_msg_len: Size of err_msg_out buffer in bytes (ignored if err_msg_out is NULL)
155+
122156 Caller must free *out_batches with geneva_batches_free. */
123157GenevaError geneva_encode_and_compress_spans (GenevaClientHandle * handle ,
124158 const uint8_t * data ,
125159 size_t data_len ,
126- EncodedBatchesHandle * * out_batches );
160+ EncodedBatchesHandle * * out_batches ,
161+ char * err_msg_out ,
162+ size_t err_msg_len );
127163
128164// 2) Query number of batches.
129165size_t geneva_batches_len (const EncodedBatchesHandle * batches );
130166
131167/* 3) Upload a single batch by index (synchronous).
132168 - On success returns GENEVA_SUCCESS.
133- - On failure returns an error code. */
169+ - On failure returns an error code and optionally writes diagnostic message to err_msg_out.
170+
171+ Parameters:
172+ - handle: Client handle from geneva_client_new (required)
173+ - batches: Batches handle from encode/compress function (required)
174+ - index: Index of batch to upload (must be < geneva_batches_len(batches))
175+ - err_msg_out: Optional buffer to receive error message (can be NULL).
176+ Message will be NUL-terminated and truncated if buffer too small.
177+ Recommended size: >= 256 bytes.
178+ - err_msg_len: Size of err_msg_out buffer in bytes (ignored if err_msg_out is NULL) */
134179GenevaError geneva_upload_batch_sync (GenevaClientHandle * handle ,
135180 const EncodedBatchesHandle * batches ,
136- size_t index );
181+ size_t index ,
182+ char * err_msg_out ,
183+ size_t err_msg_len );
137184
138185
139186/* 5) Free the batches handle. */
0 commit comments