parent
b92536b649
commit
790935b2b5
2 changed files with 14 additions and 0 deletions
|
@ -97,6 +97,13 @@ pub enum Error {
|
|||
message: String,
|
||||
},
|
||||
|
||||
/// There was a problem running the specified function
|
||||
#[error("There was a problem running the {name}() function. {message}")]
|
||||
InvalidFunction {
|
||||
name: String,
|
||||
message: String,
|
||||
},
|
||||
|
||||
/// The wrong quantity or magnitude of arguments was given for the specified function
|
||||
#[error("Incorrect arguments for function {name}(). {message}")]
|
||||
InvalidArguments {
|
||||
|
|
|
@ -138,4 +138,11 @@ pub mod uuid {
|
|||
pub fn v7(_: ()) -> Result<Value, Error> {
|
||||
Ok(Uuid::new_v7().into())
|
||||
}
|
||||
#[cfg(not(uuid_unstable))]
|
||||
pub fn v7(_: ()) -> Result<Value, Error> {
|
||||
return Err(Error::InvalidFunction {
|
||||
name: String::from("rand::uuid::v7"),
|
||||
message: format!("This function is not enabled in this version of SurrealDB."),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue