How to get error logs if file upload request fails? #1172

Open
opened 2021-05-03 14:31:45 +00:00 by RahulChouhan96 · 0 comments
RahulChouhan96 commented 2021-05-03 14:31:45 +00:00 (Migrated from github.com)

I am trying to upload an image file to S3 and using onErrorItem hook to know if any error, and I am getting item.isError as true,

this.uploader.onErrorItem = ((item, response, status, headers): any => { // response=""; status=0; headers={};
          console.log(item.isError);      // true
        });

which means, file upload is failed. I also checked S3 and there was no file. But, there are no error logs about failure in the item object.

So, can anyone please tell me, how can I see error logs in ng2-file-upload after failing to upload a file in S3.


By the way, I found what was the error using Network Tab in Developer Tools in Google Chrome.

But it would have been much quicker if ng2-file-upload had any error logging mechanism.

This is how we can simply check any error coming while you send an API request.

IMG_20210503_194157

I am trying to upload an image file to S3 and using `onErrorItem` hook to know if any error, and I am getting `item.isError` as `true`, ```js this.uploader.onErrorItem = ((item, response, status, headers): any => { // response=""; status=0; headers={}; console.log(item.isError); // true }); ``` which means, file upload is failed. I also checked S3 and there was no file. But, **there are no error logs about failure** in the `item` object. So, can anyone please tell me, how can I see error logs in `ng2-file-upload` after failing to upload a file in S3. ---------------------------------------------------------------------------------------------------------------------- By the way, I found what was the error using **Network Tab** in **Developer Tools in Google Chrome**. But it would have been much quicker if `ng2-file-upload` had any error logging mechanism. This is how we can simply check any error coming while you send an API request. ![IMG_20210503_194157](https://user-images.githubusercontent.com/42366136/116890764-9955e500-ac4b-11eb-9a02-3dba265f21aa.jpg)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1172