replace die-expressions with Exceptions