Skip to content

feat!: raise FetchError instead of silently falling back#17

Merged
steveclarke merged 2 commits into
masterfrom
12-error-logging-observability
Mar 5, 2026
Merged

feat!: raise FetchError instead of silently falling back#17
steveclarke merged 2 commits into
masterfrom
12-error-logging-observability

Conversation

@steveclarke

Copy link
Copy Markdown
Member

Summary

  • Providers now raise Votd::FetchError instead of silently returning a default John 3:16 verse when fetch/parse fails
  • Added Votd.logger for standard Ruby logging of provider errors
  • Added Votd.on_error callback for error tracker integration (Sentry, Honeybadger, etc.)
  • Original exception preserved as FetchError#cause for debugging
  • CLI handles FetchError with user-friendly error output

Breaking change

All provider errors now raise Votd::FetchError instead of falling back to defaults. Users must rescue errors explicitly:

begin
  votd = Votd::BibleGateway.new(:niv)
rescue Votd::FetchError => e
  # handle error, use your own fallback, etc.
end

Test plan

  • All 109 specs pass
  • bundle exec ruby bin/smoke_test against live APIs
  • bin/votd verse happy path
  • bin/votd verse with network disconnected (should show error)

Closes #12

Providers no longer silently swallow exceptions and return a default
John 3:16 verse. All fetch/parse errors now raise Votd::FetchError
with the original exception preserved as #cause.

Adds Votd.logger and Votd.on_error callback for observability,
letting users integrate with standard logging or error trackers
like Sentry.

Closes #12
@steveclarke steveclarke merged commit bca08f8 into master Mar 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add error logging/observability for fetch failures

1 participant