Parse to a meaningful format in the nix output stream before hitting the running build.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::fmt::Display;
|
||||
use std::num::TryFromIntError;
|
||||
use std::str::Utf8Error;
|
||||
use std::string::FromUtf8Error;
|
||||
|
||||
@@ -16,6 +18,13 @@ pub(crate) enum CustomError {
|
||||
UrlParseError(#[allow(dead_code)] url::ParseError),
|
||||
Migrate(#[allow(dead_code)] sqlx::migrate::MigrateError),
|
||||
Sql(#[allow(dead_code)] sqlx::Error),
|
||||
TryFromIntError(#[allow(dead_code)] TryFromIntError),
|
||||
}
|
||||
|
||||
impl Display for CustomError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for CustomError {
|
||||
@@ -95,3 +104,9 @@ impl From<sqlx::Error> for CustomError {
|
||||
CustomError::Sql(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TryFromIntError> for CustomError {
|
||||
fn from(value: TryFromIntError) -> Self {
|
||||
CustomError::TryFromIntError(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user