pub enum Error {
Auth(String),
Connection(String),
Api(String),
NotFound(String),
RateLimited {
retry_after: Option<Duration>,
},
Tag(String),
Config(String),
Refused(String),
}Expand description
An error raised by the engine.
Variants§
Auth(String)
The token was rejected, or no session or JWT could be obtained.
Connection(String)
A transport failure talking to Clerk or the Suno API.
Api(String)
The Suno API returned an unexpected status or body.
NotFound(String)
The Suno API returned 404 Not Found for the requested resource.
Distinct from Api so a caller can treat a genuine absence
(a clip with no parent) as None without also swallowing a transient
5xx, which must surface as a real error.
RateLimited
The Suno API rate-limited the request, with the server’s Retry-After
hint in whole seconds when it sent one (it usually does not).
Tag(String)
Reading or writing audio metadata tags failed.
Config(String)
The config file could not be parsed or failed validation.
Refused(String)
A request was refused by an engine-side safety guard before it reached the network. Used by the crate-wide POST allow-list, which rejects any POST to a path outside the small known-safe set so a mutating request (above all a credit-spending one) can never be sent by accident.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()