Commit 9ee1f5ca authored by Javier Diaz's avatar Javier Diaz
Browse files

Returns empty value if there is no record found by a key.

parent 73e0528c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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,