Skip to content

Commit

Permalink
fix: Assume Unindexed mcap on any Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkbac committed Oct 16, 2024
1 parent 9cc298b commit bc39a52
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/kappe/convert.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import logging
import struct
import time
import warnings
from collections.abc import Generator, Iterable
from datetime import datetime, timezone
from pathlib import Path
from typing import TYPE_CHECKING

import mcap.exceptions
from mcap.reader import NonSeekingReader, make_reader
from mcap.records import Channel, Schema
from mcap.well_known import Profile, SchemaEncoding
Expand Down Expand Up @@ -74,15 +72,8 @@ def __init__(

try:
self.summary = reader.get_summary()
except (
mcap.exceptions.EndOfFile,
MemoryError,
OverflowError,
struct.error,
UnicodeDecodeError,
ValueError,
):
logger.warning('Unindexed MCAP, using non seeking reader, CAN BE SLOW!')
except Exception: # noqa: BLE001
logger.warning('Unindexed/Broken MCAP, trying to read, CAN BE SLOW!')

if self.summary:
self.statistics = self.summary.statistics
Expand Down

0 comments on commit bc39a52

Please sign in to comment.