[oden] Garbage assets, need to rewrite to IO
This commit is contained in:
parent
75fcc427ac
commit
17805fa4a6
17 changed files with 240 additions and 94 deletions
|
|
@ -18,7 +18,7 @@ pub use conversion::*;
|
|||
pub use runtime::Runtime;
|
||||
pub use value::{Value, ValueRef, ValueType};
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("too many classes have been registered")]
|
||||
TooManyClasses,
|
||||
|
|
@ -39,8 +39,8 @@ pub enum Error {
|
|||
ConversionError(String),
|
||||
#[error("an error occurred calling a rust function: {0}")]
|
||||
RustFunctionError(String),
|
||||
#[error("an exception was thrown during evaluation: {1}")]
|
||||
Exception(Value, String),
|
||||
#[error("an exception was thrown during evaluation: {1}\nStack: {2}")]
|
||||
Exception(Value, String, String),
|
||||
#[error("out of memory")]
|
||||
OutOfMemory,
|
||||
#[error("an io error occurred: {0}")]
|
||||
|
|
@ -66,7 +66,7 @@ pub type ValueResult = core::result::Result<Value, Error>;
|
|||
|
||||
pub(crate) fn throw_error(context: &ContextRef, error: Error) -> sys::JSValue {
|
||||
match error {
|
||||
Error::Exception(v, _) => unsafe {
|
||||
Error::Exception(v, _, _) => unsafe {
|
||||
sys::JS_DupValue(context.ctx, v.val);
|
||||
sys::JS_Throw(context.ctx, v.val)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue