Skip to content
Snippets Groups Projects
Commit eebfb86b authored by syuilo's avatar syuilo
Browse files

Fix bug

parent 66a90946
No related branches found
No related tags found
No related merge requests found
......@@ -39,12 +39,23 @@ export default async (url, user, folderId = null, uri = null): Promise<IDriveFil
.on('error', rej);
});
const driveFile = await create(user, path, name, null, folderId, false, uri);
log(`created: ${driveFile._id}`);
let driveFile: IDriveFile;
let error;
try {
driveFile = await create(user, path, name, null, folderId, false, uri);
log(`created: ${driveFile._id}`);
} catch (e) {
error = e;
log(`failed: ${e}`);
}
// clean-up
cleanup();
return driveFile;
if (error) {
throw error;
} else {
return driveFile;
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment