mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
fix: handle invalid credentials err while uploading file in form
This commit is contained in:
@@ -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.');
|
||||
|
||||
@@ -30,7 +30,7 @@ async function uploadFileToS3(buffer, fileName, mimeType, adapter) {
|
||||
const presignedUrl = await getSignedUrl(client, getCommand, { expiresIn: 900 }); // URL expiration time in seconds (e.g., 15 min)
|
||||
return presignedUrl;
|
||||
} catch (error) {
|
||||
console.error('Error uploading file to aws:', error);
|
||||
console.error('Error uploading file to aws:', error?.message);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user