diff --git a/src/dlt/gateway/dltApp/src/dltGateway.js b/src/dlt/gateway/dltApp/src/dltGateway.js index f0ca8120b4353706d8dd0f9dbf5b5a474db02b13..7ee723e7c2ca64281d34eb141c2db509ae3c7cb4 100644 --- a/src/dlt/gateway/dltApp/src/dltGateway.js +++ b/src/dlt/gateway/dltApp/src/dltGateway.js @@ -101,7 +101,10 @@ async function getFromDlt(call, callback) { // Send the response with the formatted JSON data callback(null, { record_id: call.request, data_json: JSON.stringify(result) }); - } catch (error) { + } catch (error) { if (error.message.includes("data not found for key")) { + // Return an empty response when no record is found + callback(null, { record_id: call.request, data_json: "{}" }); + } else { // Send failure response with error message callback({ code: grpc.status.UNKNOWN,