Skip to content

Commit 2400cec

Browse files
committed
improve error handling and rethrowing
1 parent 8e70611 commit 2400cec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Modules/GoldSourceRcon/GoldSourceRcon.psm1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ function GoldSourceRcon {
9393
$response
9494
}
9595
}catch {
96-
throw "GoldSourceRcon Failed. `nException: $($_.Exception.Message), `nStacktrace: $($_.ScriptStackTrace)"
96+
Write-Error "GoldSourceRcon Failed"
97+
throw
9798
}
9899
}
99100

Modules/SourceQuery/SourceQuery.psm1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ function SourceQuery {
431431
$udpClient.Dispose()
432432
$answer
433433
}catch {
434-
throw "SourceQuery Failed. `nException: $($_.Exception.Message), `nStacktrace: $($_.ScriptStackTrace)"
434+
Write-Error "SourceQuery Failed"
435+
throw
435436
}
436437
}
437438

0 commit comments

Comments
 (0)