Added silencer for exceptions

Implementation was almost copied from https://github.com/SquareSquash/ruby because it's better than my original attempt.