Artwork

Content provided by iteration podcast, John Jacob, and JP Sio - Web Developers. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by iteration podcast, John Jacob, and JP Sio - Web Developers or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Designing for Failures

47:34
 
Share
 

Manage episode 219793323 series 1900125
Content provided by iteration podcast, John Jacob, and JP Sio - Web Developers. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by iteration podcast, John Jacob, and JP Sio - Web Developers or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.

Designing for Failures

Failure flags and benign values

  • Sometimes responding with a nil is good enough, i.e.

    def save
    # some failing code
    rescue
    nil
    end

  • Related to this is the concept of "benign values"

The system might replace the erroneous value with a phony value that it knows to have a benign effect on the rest of the system

When the system's success doesn't depend on the outcome of the method in question, using a benign value may be the right choice. Benign values are also helpful in making the code more testable.

Example:

begin response = HTTP.get_response(url) JSON.parse(response.body) rescue Net::HTTPError { 'stock_quote' => '' } end 
  • Instead of 'puts'ing, we can usewarn`

Warning as errors

Check out this hack:

module Kernel def warn(message) raise message end end warn 'uh oh' 

Remote failure reporting

  • At OL we use Bugsnag
  • Idea of bulkheads -> a wall beyond which failures cannot have an effect on other parts of the system
  • you should put bulkheads between external services and processes

Circuit breaker pattern

Ending the program

  • Calling exit ends the whole program
  • Remember that time I used exit in the Whiz Tutor codebase?

Picks

John: User Onboard - https://www.useronboard.com/ by https://twitter.com/samuelhulick

JP: singlediv.com - https://twitter.com/samuelhulick

  continue reading

78 episodes

Artwork

Designing for Failures

iteration

113 subscribers

published

iconShare
 
Manage episode 219793323 series 1900125
Content provided by iteration podcast, John Jacob, and JP Sio - Web Developers. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by iteration podcast, John Jacob, and JP Sio - Web Developers or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.

Designing for Failures

Failure flags and benign values

  • Sometimes responding with a nil is good enough, i.e.

    def save
    # some failing code
    rescue
    nil
    end

  • Related to this is the concept of "benign values"

The system might replace the erroneous value with a phony value that it knows to have a benign effect on the rest of the system

When the system's success doesn't depend on the outcome of the method in question, using a benign value may be the right choice. Benign values are also helpful in making the code more testable.

Example:

begin response = HTTP.get_response(url) JSON.parse(response.body) rescue Net::HTTPError { 'stock_quote' => '' } end 
  • Instead of 'puts'ing, we can usewarn`

Warning as errors

Check out this hack:

module Kernel def warn(message) raise message end end warn 'uh oh' 

Remote failure reporting

  • At OL we use Bugsnag
  • Idea of bulkheads -> a wall beyond which failures cannot have an effect on other parts of the system
  • you should put bulkheads between external services and processes

Circuit breaker pattern

Ending the program

  • Calling exit ends the whole program
  • Remember that time I used exit in the Whiz Tutor codebase?

Picks

John: User Onboard - https://www.useronboard.com/ by https://twitter.com/samuelhulick

JP: singlediv.com - https://twitter.com/samuelhulick

  continue reading

78 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide

Copyright 2025 | Privacy Policy | Terms of Service | | Copyright
Listen to this show while you explore
Play