The Wire · Showcase
ELIXIR TIGHTENS ERROR HANDLING ACROSS DATE, ECTO, AND IEXHELPERS
By RepoJournal · Filed · About Elixir & Phoenix
Date.range now surfaces ArgumentError instead of Protocol.UndefinedError when passed invalid step values, catching a class of bugs that silently fail in production code.
The core fix lands in elixir-lang/elixir where Date.range/3 now validates step arguments before attempting to stringify them, raising the correct ArgumentError [1] instead of confusing protocol errors. Alexander Gubarev also patched IEx.Helpers.h to print correct specs for default arg functions [2], a polish that keeps introspection reliable. Over in ecto, a breaking change merged that enforces writable fields after prepare_changes callbacks [3], catching code that was already broken but silently succeeding. The change adds `drop_non_writable_changes!/4` on prepare results, technically a breaking change but one that fixes #4770. Phoenix LiveView picked up asset updates [4] and attribution fixes [5] to keep the rendering pipeline clean. Across all three repos, the pattern is the same: fail fast with correct error types rather than propagating confusion downstream.
One email a day. Unsubscribe in one click.
Keep up with Elixir & Phoenix in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Audit your Date.range calls if you accept user-provided step values elixir-lang/elixir [plan]
- → Review prepare_changes callbacks in Ecto schemas for non-writable field mutations before upgrading elixir-ecto/ecto [plan]
- → Update Phoenix LiveView assets at next release cycle phoenixframework/phoenix_live_view [monitor]
References
- [1] Fix Date.range/3 raises wrong exception for invalid step ↗ elixir-lang/elixir
- [2] Fix IEx.Helpers.h print spec for default arg function ↗ elixir-lang/elixir
- [3] Enforce writable fields after prepare_changes (#4771) elixir-ecto/ecto
- [4] Update assets phoenixframework/phoenix_live_view
- [5] fix missing attribution phoenixframework/phoenix_live_view