Skip to content

Commit

Permalink
EPOC-394 Resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevintoormimik committed Nov 19, 2021
1 parent 9ff6591 commit d435a56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
15 changes: 0 additions & 15 deletions src/external/essRequests/requestDataHelper.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
const Promise = require('bluebird');
const fs = require('fs-extra');

<<<<<<< HEAD
const logger = require('@bananabread/sumologic-winston-logger');
const { getRichError } = require('@bananabread/response-helper');

=======
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
const { anaxContainersStorageDir } = require('../../configuration/config');
const { shortenNodeId } = require('../../util/nodeUtil');

Expand All @@ -32,31 +29,19 @@ const getRequestData = (nodeId, agreementId) => Promise.resolve()
authDataPromises.push(fs.access(essSocketFilePath)
.then(() => essSocketFilePath)
.catch((err) => {
<<<<<<< HEAD
throw getRichError('System', 'Failed to find/access to socketPath for nodeId', { nodeId, essSocketFilePath }, err, 'error', correlationId);
=======
throw new Error(`Failed to find/access to socketPath for nodeId, error: ${err}`);
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
}));

authDataPromises.push(fs.readJSON(authKeyFilePath)
.catch((err) => {
<<<<<<< HEAD
throw getRichError('System', 'ESS Auth key file cannot be read', { nodeId, authKeyFilePath, correlationId }, err, 'error', correlationId);
=======
throw new Error(`ESS Auth key file cannot be read, error: ${err}`);
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
})
.then(({ id, token }) => Buffer.from(`${id}:${token}`).toString('base64')));

authDataPromises.push(fs.readFile(certFilePath)
.then((content) => {
if (!content) {
<<<<<<< HEAD
throw getRichError('System', 'ESS Cert file does not contain anything', { nodeId, certFilePath, correlationId }, null, 'error', correlationId);
=======
throw new Error('ESS Cert file does not contain anything');
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
}

let fetchedCert;
Expand Down
12 changes: 0 additions & 12 deletions src/external/essRequests/socketHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ const dataRequest = (nodeId, request, correlationId) => new Promise((resolve, re
});

res.on('error', (error) => {
<<<<<<< HEAD
reject(getRichError('System', 'Received error from ESS socket', { nodeId, request, correlationId }, error, 'error', correlationId));
=======
reject(new Error(`Received error from ESS socket, error: ${error}`));
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
});

res.on('close', () => {
Expand All @@ -39,10 +35,6 @@ const dataRequest = (nodeId, request, correlationId) => new Promise((resolve, re
code: res.statusCode,
message: res.statusMessage,
};
<<<<<<< HEAD
=======

>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
resolve(result);
});
};
Expand All @@ -61,11 +53,7 @@ const fileDownloadRequest = (nodeId, outputFilePath, request) => new Promise((re
});

res.on('error', (error) => {
<<<<<<< HEAD
reject(getRichError('System', 'Received error from ESS socket', { nodeId, request, correlationId }, error, 'error', correlationId));
=======
reject(new Error(`Received error from ESS socket, error: ${error}`));
>>>>>>> 9f20540672076bbb5e27feafad0401b9a38fb699
});

res.on('close', () => {
Expand Down

0 comments on commit d435a56

Please sign in to comment.