Comments for Delete a Note


From @jayair on Fri Apr 20 2018 17:30:31 GMT+0000 (UTC)

@alex-romanov A couple of things to check. Check the CORS config we set in this chapter - And make sure the IAM policy in the chapter is set properly - There are also some tips on debugging the IAM policy here -


Added a delete function to aws-libs. It works but how can I get information out of the promise I get from delete a file? I want to know if the delete was succesfull e.g. if the file existed. The docs says: * Promise resolves upon successful removal of the object but I don’t know what that means.

 export async function s3Delete(filename) {
     const promise = await Storage.vault.remove(filename);
     //how do I check if object was successfully removed?
     return true;


I’m not entirely sure for this case but for promises with async/await you want to use the try/catch pattern. So wrap it in a try/catch and it should throw an error if it failed to remove it.