voicemeeter-rb/lib/voicemeeter/errors.rb

25 lines
518 B
Ruby
Raw Normal View History

module Voicemeeter
module Errors
2023-08-01 23:41:23 +01:00
class VMError < StandardError; end
# Base Voicemeeter error class
class VMInstallError < VMError; end
# Errors raised during installation.
class VMCAPIError < VMError
2023-08-01 23:41:23 +01:00
# Errors raised when the C-API returns error codes
attr_reader :fn_name, :code
def initialize(fn_name, code)
@fn_name = fn_name
@code = code
super(message)
end
def message
"#{fn_name} returned #{code}"
end
end
end
end