supabase_management_rs/error.rs
1use std::fmt;
2
3impl std::error::Error for Error {}
4
5#[derive(Debug)]
6pub struct Error(pub(crate) Box<str>);
7
8pub(crate) fn with_context(msg: std::fmt::Arguments<'_>) -> Error {
9 Error(format!("{msg}").into())
10}
11
12impl fmt::Display for Error {
13 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14 write!(f, "{}", self.0)
15 }
16}