Skip to content

Commit

Permalink
Add better support for errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uk1 committed Jan 16, 2019
1 parent 5bffc28 commit 5f2ba3f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,13 @@ impl<'a> Context<'a> {
} catch (_) {
return 'Object';
}
// TODO we could test for more things here, like `Set`s and `Map`s.
} else {
return className;
}
// errors
if (val instanceof Error) {
return `${className}: ${val.message}\n${val.stack}`;
}
// TODO we could test for more things here, like `Set`s and `Map`s.
return className;
};
const val = getObject(i);
const debug = debug_str(val);
Expand Down

0 comments on commit 5f2ba3f

Please sign in to comment.