mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 04:49:21 +02:00
Handle 'cannotExportFile' + fix forms
This commit is contained in:
@@ -462,8 +462,26 @@ class GoogleDriveConnector(LoadConnector, PollConnector):
|
|||||||
for permission in file["permissions"]
|
for permission in file["permissions"]
|
||||||
):
|
):
|
||||||
continue
|
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
|
||||||
|
|
||||||
text_contents = extract_text(file, service) or ""
|
raise
|
||||||
|
|
||||||
doc_batch.append(
|
doc_batch.append(
|
||||||
Document(
|
Document(
|
||||||
|
@@ -8,13 +8,12 @@ interface ListInputProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ListInput: React.FC<ListInputProps> = ({ field }) => {
|
const ListInput: React.FC<ListInputProps> = ({ field }) => {
|
||||||
const { values } = useFormikContext();
|
const { values } = useFormikContext<any>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextArrayField
|
<TextArrayField
|
||||||
name={field.name}
|
name={field.name}
|
||||||
label={field.label}
|
label={field.label}
|
||||||
values={Array.isArray(values) ? values : []}
|
values={values}
|
||||||
subtext={field.description}
|
subtext={field.description}
|
||||||
placeholder={`Enter ${field.label.toLowerCase()}`}
|
placeholder={`Enter ${field.label.toLowerCase()}`}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user