diff --git a/stdlib/src/uuid.rs b/stdlib/src/uuid.rs index 2a3ed70d..5897b9d8 100644 --- a/stdlib/src/uuid.rs +++ b/stdlib/src/uuid.rs @@ -17,7 +17,15 @@ impl StdlibRegistry { use std::time::SystemTime; let nano = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() + .map_err(|e| { + RuntimeError::new( + techscript_runtime::error::RuntimeErrorKind::InvalidOperation( + format!("System time before UNIX EPOCH: {}", e), + ), + None, + None, + ) + })? .as_nanos(); Ok(RuntimeValue::Str(format!( "123e4567-e89b-12d3-a456-{}", diff --git a/stdlib/tests/stdlib_tests.rs b/stdlib/tests/stdlib_tests.rs index e21f67b9..ff8bfe76 100644 --- a/stdlib/tests/stdlib_tests.rs +++ b/stdlib/tests/stdlib_tests.rs @@ -1253,5 +1253,4 @@ fn test_ai_generate_text() { } #[test] -<< -} +< \ No newline at end of file