I have a functional code for uploading files to Azure blob storage from frontend TypeScript. I need to handle errors that may occur during the upload process, such as network issues. How can we effectively catch and manage these errors on the client side? For example, if an upload of a 1GB file is interrupted by a network problem, will it automatically resume once the connection is restored or will it start over?
const blobServiceClient = new BlobServiceClient(`https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net`,credentials);
const containerClient = blobServiceClient.getContainerClient(containerName);
const fileName = path.basename(localFilePath);
const blobClient = containerClient.getBlobClient("folder1/"+fileName);
//const blobClient = containerClient.getBlobClient(fileName);
const blockBlobClient = blobClient.getBlockBlobClient();
blockBlobClient.uploadFile(localFilePath);