use crate::bindings::golem::agent::common::ValueAndType;
use crate::golem_agentic::golem::agent::common::AgentError;
use crate::value_and_type::IntoValue;
pub fn custom_error(msg: impl ToString) -> AgentError {
AgentError::CustomError(ValueAndType {
value: msg.to_string().into_value(),
typ: String::get_type(),
})
}
pub fn internal_error(msg: impl ToString) -> AgentError {
custom_error(format!("Internal error: {}", msg.to_string()))
}
pub fn invalid_input_error(msg: impl ToString) -> AgentError {
AgentError::InvalidInput(msg.to_string())
}
pub fn invalid_method_error(method_name: impl ToString) -> AgentError {
AgentError::InvalidMethod(method_name.to_string())
}