Skip to content

Commit

Permalink
Merge pull request #113 from smartive/fix/recordings-logs
Browse files Browse the repository at this point in the history
fix: recording logs
  • Loading branch information
nickredmark authored Aug 27, 2024
2 parents 622318f + 5cb74e7 commit 7ffb921
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ app.all('*', async (req, res) => {
recordingsContext.recordings[hash].push({
body,
status,
request: {
...dataToHash,
},
request: dataToHash,
});
} catch (e) {
console.log({
Expand Down Expand Up @@ -295,10 +293,11 @@ app.all('*', async (req, res) => {
return;
}

const errorMessage = `Request ${req.url} didn't match any registered route. ${JSON.stringify(req.url, null, 2)}`;

res.status(400).send({
error: errorMessage,
error: {
routes: `Request ${req.url} didn't match any registered route. ${JSON.stringify(req.url, null, 2)}`,
recordings: `Hash ${dataToHash} didn't match any recordings. Request data: ${JSON.stringify(dataToHash, null, 2)}`,
},
url: req.url,
});
});
Expand Down

0 comments on commit 7ffb921

Please sign in to comment.