We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcefc1a commit 0f48bb1Copy full SHA for 0f48bb1
src/lib.rs
@@ -1,6 +1,8 @@
1
#![warn(unused_crate_dependencies)]
2
3
pub mod apis;
4
+use std::fmt::{Display, Formatter, self};
5
+
6
pub use apis::*;
7
pub mod openai;
8
pub use openai::*;
@@ -20,3 +22,12 @@ pub enum Error {
20
22
/// An Error not related to the API
21
23
RequestError(String),
24
}
25
26
+impl Display for Error {
27
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
28
+ match self {
29
+ Error::ApiError(msg) => write!(f, "API error: {}", msg),
30
+ Error::RequestError(msg) => write!(f, "Request error: {}", msg),
31
+ }
32
33
+}
0 commit comments