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

Got Unhandled Promise Rejection Runtim error #97

Open
movila opened this issue Mar 8, 2024 · 0 comments
Open

Got Unhandled Promise Rejection Runtim error #97

movila opened this issue Mar 8, 2024 · 0 comments

Comments

@movila
Copy link

movila commented Mar 8, 2024

I'm using the example lambda code to upload file stream, but received Unhandled Promise Rejection AccessDenied Error

and the try catch block doesn't work, is there a way to proper catch the error?

try {
    const writable = s3LamZip.default
    .setArchiverOptions({
      zlib: {level: 1}
    })
    .archive(
      {
        s3: client,
        bucket: sourceBucket,
        preserveFolderStructure: true,
        debug: true,
      },
      "",
      files,
      arcFiles
    );
    const body = Readable.from(writable);

    const parallelUploads3 = new Upload({
      client: client,
      params: {Bucket: destBucket, Key: destkey, Body: body},
      queueSize: 12,
    });

    parallelUploads3.on("httpUploadProgress", function (evt) {
      console.log(evt);
    });

    await parallelUploads3.done();
  } catch (e) {
    const err = "catched error: " + e;
    console.log(err);
  }
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

No branches or pull requests

1 participant