scouter_sql/sql/
error.rs

1use scouter_dataframe::error::DataFrameError;
2use scouter_types::error::ProfileError;
3use scouter_types::error::RecordError;
4use sqlx::Error as SqlxError;
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub enum SqlError {
9    #[error(transparent)]
10    SqlxError(#[from] SqlxError),
11
12    #[error("Failed to run migrations")]
13    MigrateError(#[from] sqlx::migrate::MigrateError),
14
15    #[error(transparent)]
16    RecordError(#[from] RecordError),
17
18    #[error("Invalid record type: {0}")]
19    InvalidRecordTypeError(String),
20
21    #[error(transparent)]
22    SemverError(#[from] semver::Error),
23
24    #[error(transparent)]
25    VersionError(#[from] scouter_semver::error::VersionError),
26
27    #[error("Begin datetime must be before end datetime")]
28    InvalidDateRangeError,
29
30    #[error(transparent)]
31    DataFrameError(#[from] DataFrameError),
32
33    #[error(transparent)]
34    SerdeJsonError(#[from] serde_json::Error),
35
36    #[error(transparent)]
37    CronError(#[from] cron::error::Error),
38
39    #[error("Failed to get next run for cron schedule")]
40    GetNextRunError,
41
42    #[error("Empty batch of records")]
43    EmptyBatchError,
44
45    #[error("Record batch type is not supported")]
46    UnsupportedBatchTypeError,
47
48    #[error(transparent)]
49    ProfileError(#[from] ProfileError),
50}