File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,22 @@ function Invoke-ExecAppInsightsQuery {
2727 return [HttpResponseContext ]@ {
2828 StatusCode = [HttpStatusCode ]::OK
2929 Body = @ {
30- Results = @ ($LogData )
31- }
32- Metadata = @ {
33- Query = $Query
30+ Results = @ ($LogData )
31+ Metadata = @ {
32+ Query = $Query
33+ }
3434 }
3535 }
3636
3737 } catch {
3838 return [HttpResponseContext ]@ {
3939 StatusCode = [HttpStatusCode ]::InternalServerError
4040 Body = @ {
41- Error = " Failed to execute Application Insights query: $ ( $_.Exception.Message ) "
41+ Results = " Failed to execute Application Insights query: $ ( $_.Exception.Message ) "
42+ Metadata = @ {
43+ Query = $Query
44+ Exception = Get-CippException - Exception $_
45+ }
4246 }
4347 }
4448 }
You can’t perform that action at this time.
0 commit comments