Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/allow no meta data #1113

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions redbox-core/redbox/loader/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ def create_file_metadata(self, page_content: str, metadata: dict[str, Any]) -> d
except ConnectionError as e:
logger.warning(f"Retrying due to HTTPError {e}")
except json.JSONDecodeError:
logger.error("failed to encode metadata into json")
# replace with fail safe metadata
return None
return metadata
except Exception as e:
raise Exception(f"Some error happened in metadata extraction. {e}")
logger.error(f"Unhandled error happened in metadata extraction. {e}")
return metadata


def coerce_to_string_list(input_data: str | list[Any]) -> list[str]:
Expand Down
Loading