This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Default Ethon error class for all custom errors.
|
||||
class EthonError < StandardError
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when global_init failed.
|
||||
class GlobalInit < EthonError
|
||||
def initialize
|
||||
super("An error occured initializing curl.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when option is invalid.
|
||||
class InvalidOption < EthonError
|
||||
def initialize(option)
|
||||
super("The option: #{option} is invalid.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when option is invalid.
|
||||
class InvalidValue < EthonError
|
||||
def initialize(option, value)
|
||||
super("The value: #{value} is invalid for option: #{option}.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when multi_add_handle failed.
|
||||
class MultiAdd < EthonError
|
||||
def initialize(code, easy)
|
||||
super("An error occured adding the easy handle: #{easy} to the multi: #{code}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when multi_fdset failed.
|
||||
class MultiFdset < EthonError
|
||||
def initialize(code)
|
||||
super("An error occured getting the fdset: #{code}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raises when multi_remove_handle failed.
|
||||
class MultiRemove < EthonError
|
||||
def initialize(code, easy)
|
||||
super("An error occured removing the easy handle: #{easy} from the multi: #{code}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raised when multi_timeout failed.
|
||||
class MultiTimeout < EthonError
|
||||
def initialize(code)
|
||||
super("An error occured getting the timeout: #{code}")
|
||||
# "An error occured getting the timeout: #{code}: #{Curl.multi_strerror(code)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Ethon
|
||||
module Errors
|
||||
|
||||
# Raised when select failed.
|
||||
class Select < EthonError
|
||||
def initialize(errno)
|
||||
super("An error occured on select: #{errno}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user