ErrorMessage removed from error classes

This commit is contained in:
onyx-and-iris 2023-08-16 15:13:30 +01:00
parent a78cdf9a99
commit 844eaeabaa

View File

@ -1,17 +1,10 @@
class VMRemoteError : Exception { class VMRemoteError : Exception {
[string]$msg VMRemoteError ([string]$msg) : base ($msg) {
VMRemoteError ([string]$msg) {
$this.msg = $msg
}
[string] ErrorMessage () {
return $this.msg
} }
} }
class LoginError : VMRemoteError { class LoginError : VMRemoteError {
LoginError ([string]$msg) : base ([string]$msg) { LoginError ([string]$msg) : base ($msg) {
} }
} }
@ -19,12 +12,8 @@ class CAPIError : VMRemoteError {
[int]$retval [int]$retval
[string]$caller [string]$caller
CAPIError ([int]$retval, [string]$caller) { CAPIError ([int]$retval, [string]$caller) : base ("$caller returned $retval") {
$this.retval = $retval $this.retval = $retval
$this.caller = $caller $this.caller = $caller
} }
}
[string] ErrorMessage () {
return "CAPI return value: {0} in {1}" -f $this.retval, $this.caller
}
}