/usr/lib/ruby/1.8/svn/error.rb is in libsvn-ruby1.8 1.6.17dfsg-3ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | require "svn/util"
require "svn/ext/core"
module Svn
class Error < StandardError
class << self
# This is for backward compatibility with 1.4 or earlier.
def new_corresponding_error(*args)
SvnError.new_corresponding_error(*args)
end
end
class SvnError < Error
TABLE = {}
class << self
def new_corresponding_error(code, message, file=nil, line=nil, child=nil)
if TABLE.has_key?(code)
TABLE[code].new(message, file, line, child)
else
new(code, message, file, line, child)
end
end
end
attr_reader :code, :error_message, :file, :line
def initialize(code, message, file=nil, line=nil, child=nil)
@code = code
@error_message = message
@file = file
@line = line
@child = child
message = ""
if file
message << "#{file}"
message << ":#{line}" if line
message << ": "
end
message << "#{TABLE[@code] || @code}: "
message << @error_message
message = Converter.to_locale_encoding(message)
message = "\n#{@child.message}" if @child
super(message)
end
end
Ext::Core.constants.each do |const_name|
if /^SVN_ERR_(.*)/ =~ const_name
error_const_name = $1
next if /_CATEGORY_START\z/ =~ error_const_name
error_class_name = Util.to_ruby_class_name(error_const_name)
value = Ext::Core.const_get(const_name)
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
class #{error_class_name} < SvnError
def initialize(message="", file=nil, line=nil, child=nil)
super(#{value}, message, file, line, child)
end
end
# This is for backward compatibility with 1.4 or earlier.
#{error_const_name} = #{error_class_name}
EOC
SvnError::TABLE[value] = const_get(error_class_name)
end
end
class FsAlreadyClose < Error
end
class ReposAlreadyClose < Error
end
WcMismatchedChangeList = WcMismatchedChangelist
end
end
|