Skip to content

Commit

Permalink
working with new error handling on parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Farmer committed Oct 4, 2010
1 parent a6b1802 commit 209aaf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/kynetx_am_api/application.rb
Expand Up @@ -278,7 +278,7 @@ def set_krl(krl)
return true
else
puts "ERROR SAVING KRL: #{response.inspect}" if $DEBUG
raise KRLParseError "Unable to parse the KRL", response["error"]
raise KRLParseError.new "Unable to parse the KRL", response["error"]
end
end

Expand Down
5 changes: 1 addition & 4 deletions lib/kynetx_am_api/krl_parse_error.rb
Expand Up @@ -3,10 +3,7 @@ class KRLParseError < StandardError
attr_reader :parse_errors

def initialize(msg, errors)
if errors.class == String
msg = errors
@parse_errors = errors
elsif errors.class == Array
if errors.class == Array
@parse_errors = errors
else
@parse_errors = errors.to_s
Expand Down

0 comments on commit 209aaf3

Please sign in to comment.