Convert panic() call to more specific, overrideable method