mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
Fix bug
This commit is contained in:
parent
3eee92aae4
commit
b72d7e9fe5
@ -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;
|
||||||
|
|
||||||
|
try {
|
||||||
|
driveFile = await create(user, path, name, null, folderId, false, uri);
|
||||||
log(`created: ${driveFile._id}`);
|
log(`created: ${driveFile._id}`);
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
log(`failed: ${e}`);
|
||||||
|
}
|
||||||
|
|
||||||
// clean-up
|
// clean-up
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
return driveFile;
|
return driveFile;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user