diff --git a/lib/errors.ps1 b/lib/errors.ps1 index 22b2658..f2e33dc 100644 --- a/lib/errors.ps1 +++ b/lib/errors.ps1 @@ -1,17 +1,10 @@ class VMRemoteError : Exception { - [string]$msg - - VMRemoteError ([string]$msg) { - $this.msg = $msg - } - - [string] ErrorMessage () { - return $this.msg + VMRemoteError ([string]$msg) : base ($msg) { } } class LoginError : VMRemoteError { - LoginError ([string]$msg) : base ([string]$msg) { + LoginError ([string]$msg) : base ($msg) { } } @@ -19,12 +12,8 @@ class CAPIError : VMRemoteError { [int]$retval [string]$caller - CAPIError ([int]$retval, [string]$caller) { + CAPIError ([int]$retval, [string]$caller) : base ("$caller returned $retval") { $this.retval = $retval $this.caller = $caller } - - [string] ErrorMessage () { - return "CAPI return value: {0} in {1}" -f $this.retval, $this.caller - } -} +} \ No newline at end of file