From 70bf2d9210b669145f86762247a682d23beb87ed Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Sat, 26 Oct 2024 15:49:59 +0700 Subject: [PATCH] docs: Add error handling --- rust/pact_ffi/src/log/ffi.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/pact_ffi/src/log/ffi.rs b/rust/pact_ffi/src/log/ffi.rs index 5f1bb40a..ff913b05 100644 --- a/rust/pact_ffi/src/log/ffi.rs +++ b/rust/pact_ffi/src/log/ffi.rs @@ -262,6 +262,12 @@ pub unsafe extern "C" fn pactffi_logger_attach_sink( /// /// This function will install a global tracing subscriber. Any attempts to modify the logger /// after the call to `logger_apply` will fail. +/// +/// # Error Handling +/// +/// The return error codes are as follows: +/// +/// - `-1`: Can't set logger (applying the logger failed, perhaps because one is applied already). #[no_mangle] pub extern "C" fn pactffi_logger_apply() -> c_int { let status = match apply_logger() {