Credo: the catch-all rescues that stay say why

1af73d2 · Gabe Morell · 2026-11-04 21:21

13 files +12 -0

Files changed

modified apps/room_gtfs/lib/room_gtfs/gtfs_worker.ex
+4 −0
@@ -1288,6 +1288,10 @@ defmodule RoomGtfs.Worker.RT do
1288 1288 try do
1289 1289 {:ok, TransitRealtime.FeedMessage.decode(body)}
1290 1290 rescue
1291 + # Garbage bytes can fail the decoder in more ways than
1292 + # Protobuf.DecodeError, and any of them is just a feed that did not
1293 + # decode; the caller handles {:error, :decode_failed}.
1294 + # credo:disable-for-next-line ExSlop.Check.Warning.RescueWithoutReraise
1291 1295 e ->
1292 1296 Logger.warning("failed to decode gtfs-rt protobuf from #{url}: #{inspect(e)}")
1293 1297 {:error, :decode_failed}
modified apps/room_icarus/lib/room_icarus/worker.ex
+4 −0
@@ -340,6 +340,10 @@ defmodule RoomIcarus.Worker do
340 340 _ -> nil
341 341 end
342 342 rescue
343 + # Not just a missing row (Ecto.NoResultsError): a malformed id raises
344 + # Ecto.Query.CastError and a database fault raises its own errors, and
345 + # every one of them means there is no foci to anchor on.
346 + # credo:disable-for-next-line ExSlop.Check.Warning.BlanketRescue
343 347 _ -> nil
344 348 end
345 349 end
modified apps/room_pollen/lib/room_pollen/worker.ex
+4 −0
@@ -164,6 +164,10 @@ defmodule RoomPollen.Worker do
164 164 _ -> nil
165 165 end
166 166 rescue
167 + # Not just a missing row (Ecto.NoResultsError): a malformed id raises
168 + # Ecto.Query.CastError and a database fault raises its own errors, and
169 + # every one of them means there is no foci to anchor on.
170 + # credo:disable-for-next-line ExSlop.Check.Warning.BlanketRescue
167 171 _ -> nil
168 172 end
169 173 end

Parents: 5772d6b