5 class Error < StandardError
7 # This is for backward compatibility with 1.4 or earlier.
8 def new_corresponding_error(*args)
9 SvnError.new_corresponding_error(*args)
13 class SvnError < Error
17 def new_corresponding_error(code, message, file=nil, line=nil)
18 if TABLE.has_key?(code)
19 TABLE[code].new(message, file, line)
21 new(code, message, file, line)
26 attr_reader :code, :error_message, :file, :line
27 def initialize(code, message, file=nil, line=nil)
29 @error_message = message
35 msg << ":#{line}" if line
39 super(Converter.to_locale_encoding(msg))
43 Ext::Core.constants.each do |const_name|
44 if /^SVN_ERR_(.*)/ =~ const_name
46 next if /_CATEGORY_START\z/ =~ error_const_name
47 error_class_name = Util.to_ruby_class_name(error_const_name)
48 value = Ext::Core.const_get(const_name)
49 module_eval(<<-EOC, __FILE__, __LINE__ + 1)
50 class #{error_class_name} < SvnError
51 def initialize(message="", file=nil, line=nil)
52 super(#{value}, message, file, line)
55 # This is for backward compatibility with 1.4 or earlier.
56 #{error_const_name} = #{error_class_name}
58 SvnError::TABLE[value] = const_get(error_class_name)
62 class FsAlreadyClose < Error
65 class ReposAlreadyClose < Error
68 WcMismatchedChangeList = WcMismatchedChangelist