Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Error handling in doneWithImages() of pass.js #25

Open
yagamy4680 opened this issue Feb 1, 2015 · 0 comments
Open

Error handling in doneWithImages() of pass.js #25

yagamy4680 opened this issue Feb 1, 2015 · 0 comments

Comments

@yagamy4680
Copy link

I met an error that passbook module doesn't throw out error when wwdr.pem is not stored at the key directory:

Error opening certificate file /workspaces/pass_book_server/work/data/developers/E5WU58LN/keys/wwdr.pem
139861670852256:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen('/workspaces/pass_book_server/work/data/developers/E5WU58LN/keys/wwdr.pem','r')
139861670852256:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:172:

After debugging, I figure out that doneWithImages() doesn't handle the error from callback of self.signZip() properly, so I modify doneWithImages() as below to fix this bug.

  function doneWithImages() {
    if (lastError) {
      zip.close();
      self.emit("error", lastError);
    } else {
      self.signZip(zip, manifest, function(error) {
        // add codes: BEGIN
        if (error) {
          self.emit("error", error);          
        }
        // add codes: END
        zip.close();
        zip.on("end", function() {
          self.emit("end");
        });
        zip.on("error", function(error) {
          self.emit("error", error);
        });
      });
    }
  }

I will try to fork your repository, add test, and send pull request back to you for this issue later.

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

No branches or pull requests

1 participant