use thiserror::Error;
use wdpe::error::WebDynproError;
#[derive(Error, Debug)]
pub enum RusaintError {
#[error("WebDynpro engine error: {0}")]
WebDynproError(#[from] WebDynproError),
#[error("Invalid Client for target application")]
InvalidClientError,
#[error("Failed to login with ssu sso: {0}")]
SsoLoginError(#[from] SsuSsoError),
#[error("Error from application: {0}")]
ApplicationError(#[from] ApplicationError),
}
#[derive(Error, Debug)]
pub enum SsuSsoError {
#[error("Request error: {0}")]
RequestError(#[from] reqwest::Error),
#[error("Can't load form data from page, is page changed?")]
CantLoadForm,
#[error("Token is not included in response: {0}")]
CantFindToken(String),
}
#[derive(Error, Debug)]
pub enum ApplicationError {
#[error("No chapel information provided")]
NoChapelInformation,
#[error("No schedule information provided")]
NoScheduleInformation,
#[error("No Lecture assessment found")]
NoLectureAssessments,
#[error("No lecture found")]
NoLectureResult,
#[error("Failed to fetch OZ data: {0}")]
OzDataFetchError(String),
}