From 4a0e23c193222f9a6e1c0d8f281435d990d7ea95 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Thu, 12 Dec 2024 10:45:07 +0100 Subject: [PATCH] return correct responses from sliger rpc --- runtime/actions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/actions.cpp b/runtime/actions.cpp index b63a223..46da58b 100644 --- a/runtime/actions.cpp +++ b/runtime/actions.cpp @@ -15,7 +15,8 @@ auto sliger::rpc::action::FlameGraph::perform_action( { auto json = vm.flame_graph_json(); if (json) { - writer->write(json.value()); + writer->write( + std::format("{{ ok: true, flameGraph: \"{}\" }}", json.value())); } else { writer->write("null"); } @@ -28,9 +29,10 @@ auto sliger::rpc::action::CodeCoverage::perform_action( { auto json = vm.code_coverage_json(); if (json) { - writer->write(json.value()); + writer->write( + std::format("{{ ok: true, codeCoverage: \"{}\" }}", json.value())); } else { - writer->write("null"); + writer->write("{ ok: false }"); } writer->flush(); };