pub enum Error {
Show 62 variants
RecordsOffMustNotContainOffsetPeriod {
offset_period: String,
},
StartPeriodAfterEndPeriod {
start: String,
end: String,
},
InvalidPeriod {
bad_value: String,
},
PeriodIsNotYearAndMonth,
PeriodIsNotYearMonthAndFortnight,
InvalidGranularityForTimeOff {
free_granularity: Granularity,
service_fees_granularity: Granularity,
},
GranularityTooCoarse {
granularity: Granularity,
max_granularity: Granularity,
target_period: String,
},
CannotInvoiceForMonthWhenCadenceIsBiWeekly,
CannotExpenseForMonthWhenCadenceIsBiWeekly,
CannotExpenseForFortnightWhenCadenceIsMonthly,
PasswordDoesNotMatch,
EmailPasswordTooShort {
min_length: usize,
actual_length: usize,
},
EmailAtomTemplateError {
underlying: String,
},
InvalidEmailAddress {
role: String,
underlying: String,
},
InvalidNameForEmail {
role: String,
underlying: String,
},
InvalidPasswordForEmail {
purpose: String,
underlying: String,
},
RecipientAddressesCannotBeEmpty,
InvalidSmtpServer {
underlying: String,
},
InvalidUtf8,
AESDecryptionFailed,
InvalidAESBytesTooShort {
expected_at_least: usize,
found: usize,
},
CreateSmtpTransportError {
underlying: String,
},
CreateEmailError {
underlying: String,
},
AddAttachmentsError {
underlying: String,
},
SendEmailError {
underlying: String,
},
InvalidDecimalToF64Conversion {
value: String,
},
InvalidDecimalFromF64Conversion {
value: f64,
},
FailedToLoadFont {
family_name: String,
},
InvalidF64String {
bad_value: String,
reason: String,
},
FailedToWriteDataToDisk {
underlying: String,
},
FailedToRonSerializeData {
type_name: String,
underlying: String,
},
InvalidCompanyInformation {
reason: String,
},
InvalidInvoiceNumberString {
invalid_string: String,
},
InvalidInvoiceInfo {
reason: String,
},
InvalidPaymentInfo {
reason: String,
},
InvalidServiceFees {
reason: String,
},
OffsetPeriodMustNotBeInRecordOfPeriodsOff {
offset_period: String,
period_kind: String,
},
SpecifiedOutputPathDoesNotExist {
path: String,
},
FailedToCreateOutputDirectory {
underlying: String,
},
TargetPeriodMustHaveExpenses {
target_period: String,
},
FailedToParseYear {
invalid_string: String,
},
FileNotFound {
path: String,
underlying: String,
},
Deserialize {
type_name: String,
error: String,
},
InvalidDayFromString {
invalid_string: String,
reason: String,
},
InvalidYearAndMonth {
underlying: String,
},
InvalidDate {
underlying: String,
},
InvalidDay {
day: i32,
reason: String,
},
InvalidMonth {
month: i32,
reason: String,
},
FailedToParseMonth {
invalid_string: String,
},
InvalidExpenseItem {
invalid_string: String,
reason: String,
},
TargetPeriodMustNotBeInRecordOfPeriodsOff {
target_period: String,
},
FailedToParsePaymentTermsNetDays {
invalid_string: String,
},
L18nNotFound {
language: Language,
},
InvalidHexColor {
invalid_string: String,
},
FailedToParseDate {
underlying: String,
},
FoundNoExchangeRate {
target: Currency,
base: Currency,
},
LoadSource {
underlying: String,
},
BuildPdf {
underlying: String,
},
ExportDocumentToPdf {
underlying: String,
},
SavePdf {
underlying: String,
},
NetworkError {
underlying: String,
},
ParseError {
underlying: String,
},
}Expand description
Error type for the logic crate, encapsulating various errors that can occur during PDF generation and manipulation.
Variants§
RecordsOffMustNotContainOffsetPeriod
The offset period must not be in the record of periods off.
StartPeriodAfterEndPeriod
The start period is after the end period.
InvalidPeriod
Not a valid YearAndMonth nor YearMonthAndFortnight
PeriodIsNotYearAndMonth
Period is not YearAndMonth
PeriodIsNotYearMonthAndFortnight
Period is not YearMonthAndFortnight
InvalidGranularityForTimeOff
GranularityTooCoarse
Granularity too coarse,
CannotInvoiceForMonthWhenCadenceIsBiWeekly
Cannot invoice for month when cadence is bi-weekly.
CannotExpenseForMonthWhenCadenceIsBiWeekly
Cannot expense for month when cadence is bi-weekly
CannotExpenseForFortnightWhenCadenceIsMonthly
Cannot expense for fortnight when cadence is monthly.
PasswordDoesNotMatch
Password does not match, e.g. when the user tries to set a password and the confirmation password does not match.
EmailPasswordTooShort
Email password is too short.
Fields
EmailAtomTemplateError
Failed to parse the email atom template, e.g. when the template is not valid.
InvalidEmailAddress
Invalid email address
InvalidNameForEmail
Invalid name for email
InvalidPasswordForEmail
RecipientAddressesCannotBeEmpty
Recipient addresses cannot be empty.
InvalidSmtpServer
Failed to parse SMTP Server
InvalidUtf8
Failed to parse a string into a valid UTF-8 string.
AESDecryptionFailed
Failed to decrypt data with AES.
InvalidAESBytesTooShort
Invalid AES bytes, e.g. when the length is not as expected.
CreateSmtpTransportError
Failed to create SMTP transport, e.g. when the SMTP server is not reachable.
CreateEmailError
Failed to create Lettre Email from Email struct.
AddAttachmentsError
Failed to add attachments to the email, e.g. when the file is not found or cannot be read.
SendEmailError
Failed to send email
InvalidDecimalToF64Conversion
Failed to convert to f64 from a Decimal
InvalidDecimalFromF64Conversion
Failed to convert f64 value to a Decimal
FailedToLoadFont
Failed to load a font, e.g. when the font file is not found or cannot be read.
InvalidF64String
Failed to parse a string into an Decimal, e.g. when the string is not a valid number.
FailedToWriteDataToDisk
Failed to write data to disk, e.g. when the file system is not accessible.
FailedToRonSerializeData
Failed to serialize data to RON format.
InvalidCompanyInformation
Error while building CompanyInformation from Terminal UI input.
InvalidInvoiceNumberString
Failed to parse invoice number from a string, e.g. when the format is incorrect.
InvalidInvoiceInfo
Error while building InvoiceInfo from Terminal UI input.
InvalidPaymentInfo
Error while building PaymentInfo from Terminal UI input.
InvalidServiceFees
Error while building ServiceFees from Terminal UI input.
OffsetPeriodMustNotBeInRecordOfPeriodsOff
The offset period must not be in the record of periods off.
SpecifiedOutputPathDoesNotExist
The manually specified output path does not exist.
FailedToCreateOutputDirectory
Failed to create the output directory for the PDF file.
TargetPeriodMustHaveExpenses
Target period must have expenses, but it does not.
FailedToParseYear
Failed to parse year
FileNotFound
Failed to load file
Deserialize
Failed to deserialize a type
InvalidDayFromString
Failed to parse Day from String
InvalidYearAndMonth
Invalid YearAndMonth
InvalidDate
Invalid date
InvalidDay
Invalid day of the month, e.g. when the day is not between 1 and 31.
InvalidMonth
Invalid month, e.g. when the month is not between 1 and 12.
FailedToParseMonth
Failed to parse Month from String
InvalidExpenseItem
Failed to parse expense item from a string, e.g. when the format is incorrect.
TargetPeriodMustNotBeInRecordOfPeriodsOff
The target period is in the record of periods off, but it must not be.
FailedToParsePaymentTermsNetDays
Failed to parse PaymentTerms NetDays from a string, e.g. when the format is incorrect.
L18nNotFound
Failed to find the localization file for a specific language.
InvalidHexColor
Failed to parse a string into a Hexcolor
FailedToParseDate
Failed to parse a date, e.g. when the format is incorrect or the date is invalid.
FoundNoExchangeRate
Error converting between currencies, e.g. when the exchange rate is not found.
Fields
LoadSource
Error when loading a resource for typst.
BuildPdf
Error when compiling Typst source to a PagedDocument.
ExportDocumentToPdf
Error when exporting a PagedDocument to PDF.
SavePdf
Error when saving the PDF to a file.
NetworkError
Error when fetching exchange rates from an API.
ParseError
Error when parsing the response from the exchange rate API.
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.impl<T> MaybeSendSync for T
impl<T> OrderedContainer<T> for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more