Exception: Proj::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/error.rb

Class Method Summary collapse

Class Method Details

.check(errno = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/error.rb', line 3

def self.check(errno=nil)
  unless errno
    errno = Context.current.errno
  end

  if errno != 0
    message = if Api.method_defined?(:proj_errno_string)
                Api.proj_errno_string(errno)
              else
                Api.pj_strerrno(errno)
              end
    raise(self, message)
  end
end