Skip to content

Commit

Permalink
Add error messages to unreachable paths
Browse files Browse the repository at this point in the history
  • Loading branch information
CUB3D authored and torokati44 committed Sep 30, 2024
1 parent 6eadb00 commit cbd18e1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions flash-lso/src/amf3/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ impl AMF3Decoder {
{
id
} else {
unreachable!()
unreachable!(
"Element in reference table has changed type to {:?}",
this.object_reference_table.get(ofi)
)
};

Ok((
Expand Down Expand Up @@ -593,7 +596,10 @@ impl AMF3Decoder {
{
id
} else {
unreachable!("{:?}", this.object_reference_table.get(ofi))
unreachable!(
"Element in reference table has changed type to {:?}",
this.object_reference_table.get(ofi)
)
};

return Ok((i, Value::StrictArray(*id, elements)));
Expand Down Expand Up @@ -627,7 +633,10 @@ impl AMF3Decoder {
{
id
} else {
unreachable!("{:?}", this.object_reference_table.get(ofi))
unreachable!(
"Element in reference table has changed type to {:?}",
this.object_reference_table.get(ofi)
)
};

Ok((i, Value::ECMAArray(*id, el, elements, elements_len)))
Expand Down Expand Up @@ -663,7 +672,10 @@ impl AMF3Decoder {
{
id
} else {
unreachable!()
unreachable!(
"Element in reference table has changed type to {:?}",
this.object_reference_table.get(ofi)
)
};

Ok((i, Value::Dictionary(*id, pairs, weak_keys == 1)))
Expand Down

0 comments on commit cbd18e1

Please sign in to comment.