commit 81cc460905dbdb78eb621be90d7df3998915ea18
parent 50af2fdc9689846ef1f28348cb088c8b6e4a8b9c
Author: Erik Loualiche <[email protected]>
Date: Fri, 6 Feb 2026 17:07:18 -0600
Fix documentation: add NickelError docstring, remove private docstring
- Add docstring to NickelError struct
- Remove docstring from private _decode_native function
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Diffstat:
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/NickelEval.jl b/src/NickelEval.jl
@@ -8,7 +8,25 @@ export check_ffi_available, nickel_eval_ffi, nickel_eval_native
export find_nickel_executable
export NickelEnum
-# Custom exception for Nickel errors
+"""
+ NickelError <: Exception
+
+Exception thrown when Nickel evaluation fails.
+
+# Fields
+- `message::String`: The error message from Nickel
+
+# Examples
+```julia
+try
+ nickel_eval("{ x = }") # syntax error
+catch e
+ if e isa NickelError
+ println("Nickel error: ", e.message)
+ end
+end
+```
+"""
struct NickelError <: Exception
message::String
end
diff --git a/src/ffi.jl b/src/ffi.jl
@@ -153,11 +153,7 @@ function nickel_eval_native(code::String)
return _decode_native(data)
end
-"""
- _decode_native(data::Vector{UInt8}) -> Any
-
-Decode binary-encoded Nickel value to Julia native types.
-"""
+# Decode binary-encoded Nickel value to Julia native types.
function _decode_native(data::Vector{UInt8})
io = IOBuffer(data)
return _decode_value(io)