Skip to content

Commit 3bc543f

Browse files
committed
Make error messages more consistent
1 parent 7035f6f commit 3bc543f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parser/elements.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ impl<'a> Element<'a> for ClipElement {
624624

625625
self.file = Some(
626626
load_audio_file(path, scene.samplerate, iterations).map_err(|e| {
627-
ParseError::from_source(e, "error loading audio file", file_value)
627+
ParseError::from_source(e, "Error loading audio file", file_value)
628628
})?,
629629
);
630630
} else {
@@ -699,7 +699,7 @@ impl<'a> Element<'a> for ClipElement {
699699
if self.channel_map.len() >= file_channels as usize {
700700
parse_error!(
701701
span,
702-
"Too many <channel> elements (file has only {} channels)",
702+
"Too many <channel> elements: file has only {} channel(s)",
703703
file_channels
704704
);
705705
}
@@ -1604,7 +1604,7 @@ impl ParseAttribute for Iterations {
16041604
fn parse_attribute(span: xml::StrSpan<'_>) -> Result<Self, ParseError> {
16051605
NonZeroU64::from_str(span.as_str())
16061606
.map_err(|e| {
1607-
ParseError::from_source(e, "error parsing attribute as positive integer", span)
1607+
ParseError::from_source(e, "Error parsing attribute as positive integer", span)
16081608
})
16091609
.map(Iterations)
16101610
}
@@ -1613,22 +1613,22 @@ impl ParseAttribute for Iterations {
16131613
impl ParseAttribute for u32 {
16141614
fn parse_attribute(span: xml::StrSpan<'_>) -> Result<Self, ParseError> {
16151615
u32::from_str(span.as_str()).map_err(|e| {
1616-
ParseError::from_source(e, "error parsing attribute as non-negative integer", span)
1616+
ParseError::from_source(e, "Error parsing attribute as non-negative integer", span)
16171617
})
16181618
}
16191619
}
16201620

16211621
impl ParseAttribute for f32 {
16221622
fn parse_attribute(span: xml::StrSpan<'_>) -> Result<Self, ParseError> {
16231623
f32::from_str(span.as_str()).map_err(|e| {
1624-
ParseError::from_source(e, "error parsing attribute as decimal value(s)", span)
1624+
ParseError::from_source(e, "Error parsing attribute as decimal value(s)", span)
16251625
})
16261626
}
16271627
}
16281628

16291629
impl ParseAttribute for XmlTime {
16301630
fn parse_attribute(span: xml::StrSpan<'_>) -> Result<Self, ParseError> {
16311631
XmlTime::from_str(span.as_str())
1632-
.map_err(|e| ParseError::from_source(e, "invalid time value", span))
1632+
.map_err(|e| ParseError::from_source(e, "Invalid time value", span))
16331633
}
16341634
}

0 commit comments

Comments
 (0)