Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making xmlError js friendly. #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gotama
Copy link

@gotama gotama commented Oct 29, 2020

With regards to #2

@@ -24,9 +24,7 @@ void set_numeric_field(Local<Object> obj, const char *name, const int value) {
Local<Value> BuildSyntaxError(xmlError *error) {
Nan::EscapableHandleScope scope;

Local<Value> err =
Exception::Error(Nan::New<String>(error->message).ToLocalChecked());
Local<Object> out = Local<Object>::Cast(err);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I removed this, because casting err to the out object is the reason the formatting for JS broke.

A stack trace doesn't fit nicely into a key value JS object. Im trying to think of a more elegant way to append a stack trace. Will update if I come up with anything.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also error->message might not be a stack trace, as im using that as xsd validation error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant