mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 23:00:48 +00:00
27 lines
514 B
Ruby
27 lines
514 B
Ruby
require_relative "util"
|
|
|
|
module Voicemeeter
|
|
module Errors
|
|
class VMError < StandardError
|
|
end
|
|
|
|
class VMCAPIError < VMError
|
|
attr_reader :code
|
|
|
|
def initialize(ruby_name, code)
|
|
@ruby_name = ruby_name
|
|
@code = code
|
|
super(message)
|
|
end
|
|
|
|
def message
|
|
"#{fn_name} returned #{code}"
|
|
end
|
|
|
|
def fn_name
|
|
"VBVMR_#{Util::String.camelcase(@ruby_name.to_s.delete_prefix("bind_")).sub("macro_button", "macrobutton")}"
|
|
end
|
|
end
|
|
end
|
|
end
|