diff --git a/src/commands/from_bson.rs b/src/commands/from_bson.rs index ab7e81994..492553e9d 100644 --- a/src/commands/from_bson.rs +++ b/src/commands/from_bson.rs @@ -186,13 +186,14 @@ impl std::io::Read for BytesReader { pub fn from_bson_bytes_to_value( bytes: Vec, tag: impl Into, -) -> bson::DecoderResult> { +) -> Result, ShellError> { let mut docs = Vec::new(); let mut b_reader = BytesReader::new(bytes); while let Ok(v) = decode_document(&mut b_reader) { docs.push(Bson::Document(v)); } - Ok(convert_bson_value_to_nu_value(&Bson::Array(docs), tag).expect("FIXME: Don't commit like this")) + + convert_bson_value_to_nu_value(&Bson::Array(docs), tag) } fn from_bson(args: CommandArgs, registry: &CommandRegistry) -> Result {