Conversation
@fallible decorator for public methods in ops mod
Greptile SummaryThis PR fixes four public synchronous methods that were missing the
Confidence Score: 5/5Safe to merge — the change is a targeted, additive fix with no logic changes. Four sync factory methods that call validators were silently letting raw exceptions escape the public API. The fix is minimal and correct: each newly decorated method already had the right logic, just needed the wrapper. The only pre-existing gap left open is S2Stream.init, which is protected indirectly by the @Fallible on S2Basin.stream(). No files require special attention beyond the single changed file. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant basin as S2.basin() @fallible
participant stream as S2Basin.stream() @fallible
participant append_session as S2Stream.append_session() @fallible
participant producer as S2Stream.producer() @fallible
participant fallible as fallible wrapper
participant validator as validators
Caller->>basin: basin("invalid-name")
basin->>validator: validate_basin(name)
validator-->>basin: raises ValueError
basin->>fallible: catches Exception
fallible-->>Caller: raises S2ClientError
Caller->>stream: "stream(name, encryption_key=...)"
stream->>validator: validate_encryption_key(key)
validator-->>stream: raises ValueError
stream->>fallible: catches Exception
fallible-->>Caller: raises S2ClientError
Caller->>append_session: "append_session(max_unacked_bytes=...)"
append_session->>validator: validate_max_unacked(...)
validator-->>append_session: raises ValueError
append_session->>fallible: catches Exception
fallible-->>Caller: raises S2ClientError
Caller->>producer: "producer(batching=...)"
producer->>validator: validate_batching(...)
validator-->>producer: raises ValueError
producer->>fallible: catches Exception
fallible-->>Caller: raises S2ClientError
|
closes #70