Update src/server.ps1
This commit is contained in:
@@ -52,7 +52,14 @@ function Start-Server {
|
||||
while ($Global:Listener.IsListening) {
|
||||
$ctx = $Global:Listener.GetContext()
|
||||
try { Dispatch-Request $ctx }
|
||||
catch { Write-LogHybrid "Dispatch error: $($_.Exception.Message)" Error Server -LogToEvent }
|
||||
catch {
|
||||
$msg = $_.Exception.Message
|
||||
$pos = if ($_.InvocationInfo) { $_.InvocationInfo.PositionMessage } else { "" }
|
||||
$stk = if ($_.ScriptStackTrace) { $_.ScriptStackTrace } else { "" }
|
||||
|
||||
Write-LogHybrid "Dispatch error: $msg`n$pos`n$stk" Error Server -LogToEvent
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user