#[non_exhaustive]pub struct AppError {
pub kind: AppErrorKind,
pub message: String,
pub stack: Option<String>,
pub package: Option<Arc<PackageInfo>>,
}Expand description
An error of the app an engine runs. Its text (fmt::Display) is the
message and the stack, as crate::MountSink::report_error receives
it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: AppErrorKindWhat went wrong.
message: StringThe message (Error: boom), without the stack.
stack: Option<String>The JS stack ( at fail (App.tsx:5:9) lines), mapped to the
app’s sources when the bundle has a source map.
package: Option<Arc<PackageInfo>>The signed package the app came from, if it did.
Implementations§
Source§impl AppError
impl AppError
Sourcepub fn new(kind: AppErrorKind, text: &str) -> AppError
pub fn new(kind: AppErrorKind, text: &str) -> AppError
An error from its text: the lines from the first stack frame on
(at …) are the stack, the ones before it the message.
Sourcepub fn with_package(self, package: Option<Arc<PackageInfo>>) -> AppError
pub fn with_package(self, package: Option<Arc<PackageInfo>>) -> AppError
Sets the package the app came from.
Sourcepub fn is_fatal(&self) -> bool
pub fn is_fatal(&self) -> bool
The app cannot go on: it did not start (AppErrorKind::Load) or
its VM was stopped (AppErrorKind::Stopped). An embedding app
would fall back to another build here.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
No JS of the app runs any more (AppErrorKind::Stopped).
Trait Implementations§
impl Eq for AppError
Source§impl Error for AppError
impl Error for AppError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for AppError
Auto Trait Implementations§
impl Forget for AppError
impl Freeze for AppErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<PackageInfo> is !null: Freeze,
PhantomData<ArcInner<PackageInfo>>: Freeze,
impl Move for AppError
impl RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<PackageInfo> is !null: UnsafeUnpin,
PhantomData<ArcInner<PackageInfo>>: UnsafeUnpin,
impl UnwindSafe for AppError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.