Skip to content

Commit

Permalink
fix: do not include that source error in its own Display representa…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticLampyrid committed Jun 21, 2024
1 parent 4c835c3 commit 681b6fd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/printer/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct PrinterDevice {
/// Represents an error occurred while enumerating printer devices.
pub enum EnumDeviceError {
/// Failed to enum printer device.
#[error("Failed to enum printer device: {0}")]
#[error("Failed to enum printer device")]
FailedToEnumPrinterDevice(#[source] windows::core::Error),
}

Expand Down
4 changes: 2 additions & 2 deletions src/printer/pdfium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ pub enum PdfiumPrinterError {
#[error("Failed to open printer")]
FailedToOpenPrinter,
/// File I/O error.
#[error("File I/O error: {0}")]
#[error("File I/O error")]
FileIOError(#[source] std::io::Error),
/// Print ticket error.
#[error("Print Ticker Error: {0}")]
#[error("Print Ticker Error")]
PrintTicketError(#[source] ToDevModeError),
}

Expand Down
10 changes: 5 additions & 5 deletions src/printer/xps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ use windows::{
/// Represents an error from [`XpsPrinter`].
pub enum XpsPrinterError {
/// Failed to create event.
#[error("Failed to create event: {0}")]
#[error("Failed to create event")]
FailedToCreateEvent(#[source] windows::core::Error),
/// Failed to create object factory.
#[error("Failed to create object factory: {0}")]
#[error("Failed to create object factory")]
FailedToCreateObjectFactory(#[source] windows::core::Error),
/// Failed to start job.
#[error("Failed to start job: {0}")]
#[error("Failed to start job")]
FailedToStartJob(#[source] windows::core::Error),
/// Failed to apply print ticket.
#[error("Failed to apply print ticket: {0}")]
#[error("Failed to apply print ticket")]
FailedToApplyPrintTicket(#[source] windows::core::Error),
/// Failed to write document.
#[error("Failed to write document: {0}")]
#[error("Failed to write document")]
FailedToWriteDocument(#[source] windows::core::Error),
/// Stream is not available.
#[error("Stream is not available")]
Expand Down
6 changes: 3 additions & 3 deletions src/ticket/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ pub struct PrintTicketBuilder {
/// Represents an error occurred while building a print ticket.
pub enum PrintTicketBuilderError {
/// Failed to open print ticket provider.
#[error("Failed to open print ticket provider: {0}")]
#[error("Failed to open print ticket provider")]
OpenProviderFailed(#[source] windows::core::Error),
/// Stream not allocated.
#[error("Stream not allocated")]
StreamNotAllocated,
/// Failed to merge print tickets.
#[error("Failed to merge print tickets: {0}")]
#[error("Failed to merge print tickets")]
MergePrintTicketsFailed(String, #[source] windows::core::Error),
/// Failed to decode print ticket.
#[error("Failed to decode print ticket: {0}")]
#[error("Failed to decode print ticket")]
DecodePrintTicketFailed(#[source] windows::core::Error),
}

Expand Down
2 changes: 1 addition & 1 deletion src/ticket/document/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use xml::{
/// Represents an error occurred while parsing print schema.
pub enum ParsePrintSchemaError {
/// Invalid XML.
#[error("Invalid xml: {0}")]
#[error("Invalid xml")]
InvalidXml(#[source] xml::reader::Error),
/// Invalid print schema.
#[error("Invalid print schema: (at {pos}) {reason}")]
Expand Down
8 changes: 4 additions & 4 deletions src/ticket/print_capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ use xml::name::OwnedName;
/// Represents an error occurred while fetching print capabilities.
pub enum FetchPrintCapabilitiesError {
/// Failed to open print ticket provider.
#[error("Failed to open print ticket provider: {0}")]
#[error("Failed to open print ticket provider")]
OpenProviderFailed(#[source] windows::core::Error),
/// Stream not allocated.
#[error("Stream not allocated")]
StreamNotAllocated,
/// Cannot get print capabilities.
#[error("Cannot get print capabilities: {0}")]
#[error("Cannot get print capabilities")]
CannotGetPrintCapabilities(String, #[source] windows::core::Error),
/// Failed to read stream.
#[error("Failed to read stream: {0}")]
#[error("Failed to read stream")]
ReadStreamFailed(#[source] windows::core::Error),
/// Failed to parse print capabilities.
#[error("Failed to parse print capabilities: {0}")]
#[error("Failed to parse print capabilities")]
ParseError(#[source] ParsePrintSchemaError),
}

Expand Down
6 changes: 3 additions & 3 deletions src/ticket/print_ticket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ impl Default for PrintTicket {
/// Represents an error occurred while converting print ticket to dev mode.
pub enum ToDevModeError {
/// Failed to open print ticket provider.
#[error("Failed to open print ticket provider: {0}")]
#[error("Failed to open print ticket provider")]
OpenProviderFailed(#[source] windows::core::Error),
/// Stream not allocated.
#[error("Stream not allocated")]
StreamNotAllocated,
/// Failed to convert print ticket to dev mode.
#[error("Failed to convert print ticket to dev mode: {0}")]
#[error("Failed to convert print ticket to dev mode")]
ConvertPrintTicketToDevModeFailed(String, #[source] windows::core::Error),
/// Failed to open printer.
#[error("Failed to open printer: {0}")]
#[error("Failed to open printer")]
FailedToOpenPrinter(#[source] windows::core::Error),
/// Failed to correct dev mode via [`DocumentProperties`].
///
Expand Down

0 comments on commit 681b6fd

Please sign in to comment.