mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 17:23:08 +02:00
Fix bug
This commit is contained in:
parent
66a9094665
commit
eebfb86b2e
1 changed files with 14 additions and 3 deletions
|
@ -39,12 +39,23 @@ export default async (url, user, folderId = null, uri = null): Promise<IDriveFil
|
||||||
.on('error', rej);
|
.on('error', rej);
|
||||||
});
|
});
|
||||||
|
|
||||||
const driveFile = await create(user, path, name, null, folderId, false, uri);
|
let driveFile: IDriveFile;
|
||||||
|
let error;
|
||||||
|
|
||||||
log(`created: ${driveFile._id}`);
|
try {
|
||||||
|
driveFile = await create(user, path, name, null, folderId, false, uri);
|
||||||
|
log(`created: ${driveFile._id}`);
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
log(`failed: ${e}`);
|
||||||
|
}
|
||||||
|
|
||||||
// clean-up
|
// clean-up
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
return driveFile;
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
return driveFile;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue