mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 03:58:30 +02:00
Handle 'cannotExportFile' + fix forms
This commit is contained in:
@@ -462,8 +462,26 @@ class GoogleDriveConnector(LoadConnector, PollConnector):
|
||||
for permission in file["permissions"]
|
||||
):
|
||||
continue
|
||||
|
||||
try:
|
||||
text_contents = extract_text(file, service) or ""
|
||||
except HttpError as e:
|
||||
reason = (
|
||||
e.error_details[0]["reason"]
|
||||
if e.error_details
|
||||
else e.reason
|
||||
)
|
||||
message = (
|
||||
e.error_details[0]["message"]
|
||||
if e.error_details
|
||||
else e.reason
|
||||
)
|
||||
if e.status_code == 403 and reason == "cannotExportFile":
|
||||
logger.warning(
|
||||
f"Could not export file '{file['name']}' due to '{message}', skipping..."
|
||||
)
|
||||
continue
|
||||
|
||||
raise
|
||||
|
||||
doc_batch.append(
|
||||
Document(
|
||||
|
@@ -8,13 +8,12 @@ interface ListInputProps {
|
||||
}
|
||||
|
||||
const ListInput: React.FC<ListInputProps> = ({ field }) => {
|
||||
const { values } = useFormikContext();
|
||||
|
||||
const { values } = useFormikContext<any>();
|
||||
return (
|
||||
<TextArrayField
|
||||
name={field.name}
|
||||
label={field.label}
|
||||
values={Array.isArray(values) ? values : []}
|
||||
values={values}
|
||||
subtext={field.description}
|
||||
placeholder={`Enter ${field.label.toLowerCase()}`}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user