fix: handle invalid credentials err while uploading file in form

This commit is contained in:
prafull-opensignlabs
2024-10-09 11:39:59 +05:30
parent 6a4124fdf0
commit d8b2a80e90
3 changed files with 16 additions and 14 deletions
@@ -44,7 +44,8 @@ export default async function saveToFileAdapter(request) {
return { url: presignedUrl };
} catch (err) {
console.error('Error generate presigned url:', err);
throw new Parse.Error(400, 'Something went wrong.');
const msg = 'Fileadapter credentials are invalid.';
throw new Parse.Error(400, msg);
}
} else {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'S3 credentials not found.');