Skip to content

Commit fb9f71b

Browse files
committed
fix errors
1 parent f10ad4c commit fb9f71b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

crates/bevy_mod_scripting_core/src/asset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl AssetLoader for ScriptAssetLoader {
4747
reader
4848
.read_to_end(&mut content)
4949
.await
50-
.map_err(|e| ScriptError::new_error(e).with_context(load_context.asset_path()))?;
50+
.map_err(|e| ScriptError::new_external(e).with_context(load_context.asset_path()))?;
5151
if let Some(processor) = &self.preprocessor {
5252
processor(&mut content)?;
5353
}

crates/bevy_mod_scripting_core/src/bindings/function.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ impl<I: Iterator<Item = ScriptValue>> IntoArgsListWithAccess for I {
235235
function_info,
236236
Some(argument_info),
237237
InteropError::impossible_conversion(argument_info.type_id()),
238-
)
239-
.into());
238+
));
240239
}
241240
};
242241

crates/bevy_mod_scripting_core/src/error.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl ScriptError {
111111
match error {
112112
mlua::Error::ExternalError(inner) => {
113113
if let Some(script_error) = inner.downcast_ref::<InteropError>() {
114-
Self::new(script_error.clone())
114+
script_error.clone().into()
115115
} else {
116116
Self::new_external(inner)
117117
}
@@ -218,6 +218,12 @@ impl DisplayWithWorld for InteropError {
218218

219219
impl_dummy_display!(InteropError);
220220

221+
impl From<InteropError> for ScriptError {
222+
fn from(val: InteropError) -> Self {
223+
ScriptError::new(val)
224+
}
225+
}
226+
221227
impl InteropError {
222228
pub fn missing_world() -> Self {
223229
Self(Arc::new(InteropErrorInner::MissingWorld))

0 commit comments

Comments
 (0)