1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
use crate::TailwindError;
use parcel_css::error::{Error, MinifyErrorKind, ParserError, PrinterErrorKind};

impl From<Error<ParserError<'_>>> for TailwindError {
    fn from(e: Error<ParserError<'_>>) -> Self {
        TailwindError::syntax_error(e.kind.reason())
    }
}

impl From<Error<MinifyErrorKind>> for TailwindError {
    fn from(e: Error<MinifyErrorKind>) -> Self {
        TailwindError::runtime_error(e.kind.reason())
    }
}

impl From<Error<PrinterErrorKind>> for TailwindError {
    fn from(e: Error<PrinterErrorKind>) -> Self {
        TailwindError::runtime_error(e.kind.reason())
    }
}