2022-01-19 05:16:28 +00:00
|
|
|
class VMRemoteErrors : Exception {
|
2022-10-27 21:20:03 +01:00
|
|
|
[string]$msg
|
2021-05-04 17:29:38 +01:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
VMRemoteErrors ([string]$msg) {
|
2021-05-04 17:29:38 +01:00
|
|
|
$this.msg = $msg
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] ErrorMessage () {
|
2021-05-04 17:29:38 +01:00
|
|
|
return $this.msg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 05:16:28 +00:00
|
|
|
class LoginError : VMRemoteErrors {
|
2022-10-27 21:20:03 +01:00
|
|
|
LoginError ([string]$msg) : base ([string]$msg) {
|
2021-04-29 20:23:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 05:16:28 +00:00
|
|
|
class CAPIError : VMRemoteErrors {
|
2022-10-27 21:20:03 +01:00
|
|
|
[int]$retval
|
|
|
|
[string]$caller
|
2021-04-29 20:23:02 +01:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
CAPIError ([int]$retval, [string]$caller) {
|
2021-04-29 20:23:02 +01:00
|
|
|
$this.retval = $retval
|
|
|
|
$this.caller = $caller
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] ErrorMessage () {
|
2021-04-29 20:23:02 +01:00
|
|
|
return "ERROR: CAPI return value: {0} in {1}" -f $this.retval, $this.caller
|
|
|
|
}
|
|
|
|
}
|