Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Rewrite reportIntrospectionError calls #1898

Open
NTillmann opened this issue May 8, 2018 · 8 comments
Open

Rewrite reportIntrospectionError calls #1898

NTillmann opened this issue May 8, 2018 · 8 comments

Comments

@NTillmann
Copy link
Contributor

Once upon a time, Prepack didn't have a real error-handling story besides just throwing an exception.
From this time, there are still a ton of reportIntrospectionError calls in the code base.

They should all be rewritten, one by one (separate pull-requests, please) into something like the following.

    let error = new CompilerDiagnostic("appropriate error message", referenceToSourceLocation, "PPxxxx", "FatalError");
    realm.handleError(error);
    throw new FatalError();

Where PPxxxx should be the next currently unused error code; check
https://github.com/facebook/prepack/wiki/Prepack-diagnostics
for all currently defined error code.

  • Create a new wiki page with the PP error number as its name.
  • Add a link to it from the page that lists all error numbers.
@chanakyabhardwajj
Copy link

Create a new wiki page with the PP error number as its name.

What's the best way to submit wiki edits? Once the (code) PR is approved/merged, do you also merge the wiki changes from the fork?

@NTillmann
Copy link
Contributor Author

As far as I understand, the wiki is separate from version control.
So, first add a wiki entry to "claim" an error code number; maybe add "(for PR under review)" to the wiki title, and then submit pull request.

@chanakyabhardwajj
Copy link

first add a wiki entry...

I apologize if I am mistaken, but I can not edit the wiki at all (as I am not part of the organization). That’s why I asked this question.

@hermanventer
Copy link
Contributor

If that is the case, things are a bit harder. I suppose if you fork the code base, you can edit the forked wiki and point to it in the PR. Any other suggestions for a good workflow are most welcome.

@chanakyabhardwajj
Copy link

Would the following workflow be acceptable?
https://gist.github.com/larrybotha/10650410

@bernard-lin
Copy link
Contributor

We could also host it on the site instead of on the wiki?

@chanakyabhardwajj
Copy link

That would (imho) simplify it for everyone in the future. However, I am happy to contribute whichever way suits you the best.

@hermanventer
Copy link
Contributor

It probably would make sense to put all of our documentation in a source controlled folder.

For now, however, let's stick to the Wiki and let's keep talking about the best way to do this. For example, which GitHub projects are models that we should look to for guidance?

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

No branches or pull requests

4 participants