@@ -131,6 +131,45 @@ struct ddog_VoidResult ddog_crasht_init_without_receiver(struct ddog_crasht_Conf
131131 */
132132struct ddog_crasht_Slice_CInt ddog_crasht_default_signals (void );
133133
134+ /**
135+ * Report an unhandled exception as a crash event.
136+ *
137+ * This function sends a crash report for an unhandled exception detected
138+ * by the runtime. It is intended to be called when the process is in a
139+ * terminal state due to an unhandled exception.
140+ *
141+ * # Parameters
142+ * - `error_type`: Optional type/class of the exception (e.g. "NullPointerException"). Pass empty
143+ * CharSlice for unknown.
144+ * - `error_message`: Optional error message. Pass empty CharSlice for no message.
145+ * - `runtime_stack`: Stack trace from the runtime. Consumed by this call.
146+ *
147+ * If the crash-tracker has not been initialized, this function is a no-op.
148+ *
149+ * # Side effects
150+ * This function disables the signal-based crash handler before performing
151+ * any work. This means that if the process receives a fatal signal (SIGSEGV)
152+ * during or after this call, the crashtracker will not produce a
153+ * second crash report. The previous signal handler (if any) will still be
154+ * chained.
155+ *
156+ * # Failure mode
157+ * If a fatal signal occurs while this function is in progress, the calling
158+ * process is in an unrecoverable state; the crashtracker cannot report the
159+ * secondary fault and the caller's own signal handler (if any) will execute
160+ * in a potentially corrupted context. Callers should treat this function as a
161+ * terminal operation and exit shortly after it returns.
162+ *
163+ * # Safety
164+ * Crash-tracking functions are not reentrant.
165+ * No other crash-handler functions should be called concurrently.
166+ * The `runtime_stack` handle must be valid and will be consumed.
167+ */
168+ DDOG_CHECK_RETURN
169+ struct ddog_VoidResult ddog_crasht_report_unhandled_exception (ddog_CharSlice error_type ,
170+ ddog_CharSlice error_message ,
171+ struct ddog_crasht_Handle_StackTrace * runtime_stack );
172+
134173/**
135174 * Removes all existing additional tags
136175 * Expected to be used after a fork, to reset the additional tags on the child
@@ -661,7 +700,12 @@ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_thread_name(struct ddog
661700 * The `builder` can be null, but if non-null it must point to a Builder made by this module,
662701 * which has not previously been dropped.
663702 * All arguments must be valid.
664- * This method requires that the builder has a UUID and metadata set
703+ * This method requires that the builder has `metadata` and `kind` set
704+ * Applications can add `message` or `sig_info` to the builder to provide additional context.
705+ * If set, the data will be used to derive the crash ping message in the order of
706+ * - an explicit message set with `with_message`
707+ * - sig_info set with `with_sig_info`
708+ * - kind set with `with_kind`
665709 */
666710DDOG_CHECK_RETURN
667711struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_upload_ping_to_endpoint (struct ddog_crasht_Handle_CrashInfoBuilder * builder ,
0 commit comments