From d7d5134b91472f5457f8defeb4325b1ada24993c Mon Sep 17 00:00:00 2001 From: dhunnapotha Date: Mon, 22 Feb 2016 23:11:15 +0530 Subject: [PATCH] The proxy example was being terminated without completion because of the exception raised --- proxy.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/proxy.rb b/proxy.rb index 4b98a11..b14b987 100644 --- a/proxy.rb +++ b/proxy.rb @@ -57,8 +57,14 @@ def execute hero = Hero.new proxy = ComputerProxy.new(hero) proxy.add("some command") -proxy.execute -# => raise error +begin + proxy.execute +rescue Exception => e + # => error message - You have no access + puts e.message +end + + hero.keywords << :computer -proxy.execute +puts proxy.execute # => executing commands