Skip to content

Commit 1254f3f

Browse files
committed
fix missing response path for uncaught exceptions
1 parent 0f8f740 commit 1254f3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Modules/CippEntrypoints/CippEntrypoints.psm1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ function Receive-CippHttpTrigger {
144144
$Response.Body = $Response.Body | ConvertTo-Json -Depth 20 -Compress
145145
}
146146
Push-OutputBinding -Name Response -Value ([HttpResponseContext]$Response)
147+
} else {
148+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
149+
StatusCode = [HttpStatusCode]::InternalServerError
150+
Body = @{
151+
error = @{
152+
code = 'InternalServerError'
153+
message = 'An error occurred processing the request'
154+
}
155+
}
156+
})
147157
}
148158
}
149159
return

0 commit comments

Comments
 (0)