2023-07-17 06:03:37 +01:00
|
|
|
require_relative "util"
|
2023-07-15 00:16:35 +01:00
|
|
|
|
2023-07-07 02:31:22 +01:00
|
|
|
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.
|
2023-07-07 02:31:22 +01:00
|
|
|
|
|
|
|
class VMCAPIError < VMError
|
2023-08-01 23:41:23 +01:00
|
|
|
# Errors raised when the C-API returns error codes
|
2023-07-25 12:58:17 +01:00
|
|
|
attr_reader :fn_name, :code
|
2023-07-15 00:16:35 +01:00
|
|
|
|
2023-07-25 12:58:17 +01:00
|
|
|
def initialize(fn_name, code)
|
|
|
|
@fn_name = fn_name
|
2023-07-15 00:16:35 +01:00
|
|
|
@code = code
|
|
|
|
super(message)
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"#{fn_name} returned #{code}"
|
|
|
|
end
|
2023-07-07 02:31:22 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|