未验证 提交 2feb661b 编写于 作者: G gewoonwoutje 提交者: GitHub

Replace panic with invalid_utf8 OpError (#4704)

Co-authored-by: NWout Elstgeest <w.elstgeest@inepro.com>
上级 3e51e67f
......@@ -156,7 +156,8 @@ fn op_fetch_source_files(
.map_err(|e| OpError::other(e.to_string()))?
.code
}
_ => String::from_utf8(file.source_code).unwrap(),
_ => String::from_utf8(file.source_code)
.map_err(|_| OpError::invalid_utf8())?,
};
Ok::<_, OpError>(json!({
"url": file.url.to_string(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册