PowerShell/Polaris

500 Error from the server responds with a collection of all errors instead of just the latest

Closed this issue · 0 comments

Polaris Bug Report

500 Errors from the server respond with a collection of all errors instead of just the latest error.

Steps to reproduce

New-PolarisGetRoute -Path '/error' -ScriptBlock { throw 'Error }
GET http://localhost:8080/error HTTP/1.1
User-Agent: Fiddler
Host: localhost:8080


HTTP/1.1 500 Internal Server Error
Content-Length: 8071
Content-Type: text/plain
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 08 Dec 2018 01:36:07 GMT


System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+  throw 'Error'
+  ~~~~~~~~~~~~~



------------------------------------------------------------------
GET http://localhost:8080/error HTTP/1.1
User-Agent: Fiddler
Host: localhost:8080


HTTP/1.1 500 Internal Server Error
Content-Length: 8177
Content-Type: text/plain
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 08 Dec 2018 01:36:09 GMT


System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+  throw 'Error'
+  ~~~~~~~~~~~~~

System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+  throw 'Error'
+  ~~~~~~~~~~~~~



------------------------------------------------------------------

Expected behavior

It should only return the latest error response

Version Information


Run the following script and copy and paste the results here:

NameVersion
Polaris0.2.0
PSVersionPSEditionPSCompatibleVersionsBuildVersionCLRVersionWSManStackVersionPSRemotingProtocolVersionSerializationVersion
5.1.17134.228Desktop1.0.-1.-1, 2.0.-1.-1, 3.0.-1.-1, 4.0.-1.-1, 5.0.-1.-1, 5.1.17134.22810.0.17134.2284.0.30319.420003.02.31.1.0.1