Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Frozen string issue in StatusException.message #1

Open
delano opened this Issue · 0 comments

1 participant

@delano
Collaborator

from: http://github.com/jamis/net-sftp/issues/closed/#issue/1
by: appoxy

I ran into this problem with net-sftp:

I catch the Exception from net-sftp and when I try to call ex.message, I get a can't modify frozen string exception.

Code:

begin
    ... something with net-sftp 
rescue Exception => ex
    puts 'CAUGHT:' + ex.message 
end

Which in turn throws another exception due to the ex.message:

Exception Message:
can't modify frozen string

Backtrace:

/usr/local/lib/ruby/gems/1.9.1/gems/net-sftp-2.0.2/lib/net/sftp/errors.rb:35:in message' run.rb:168:inrescue in block in run'
run.rb:184:in `block in run'

Confirmed that this fixes it:

def message
  m = super.dup
  m << " #{text}" if text
  m << " (#{code}, #{description.inspect})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.