Skip to content

Commit

Permalink
Merge pull request #3 from vHeemstra/patch/async-thrown-error-consist…
Browse files Browse the repository at this point in the history
…ency

Patch: consistency in Errors
  • Loading branch information
vHeemstra authored Jun 12, 2022
2 parents f3cf034 + 3310b4d commit 800d437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function fillPotPo(cb, options) {
return generatePO(pot_object, po_object, po_file, options);

}).catch(error => {
throw new PluginError(`${c.bold(error)} ${c.gray(`(PO ${c.white(po_file)})`)}`);
throw new PluginError(`${c.bold(error.message)} ${c.gray(`(PO ${c.white(po_file)})`)}`);
});

}) );
Expand Down
6 changes: 3 additions & 3 deletions test/async.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ describe('async.js - single POT', () => {
// Check returned array
expect(result).toMatch(new RegExp('POT_MOCK_FS_READFILE_ERROR'));

// Restore the console.log function
// Restore the fs.readFile function
readFileSpy.mockRestore();

done();
Expand All @@ -723,7 +723,7 @@ describe('async.js - single POT', () => {
return;
}
// then *.po
cb('PO_MOCK_FS_READFILE_ERROR', '');
cb({message: 'PO_MOCK_FS_READFILE_ERROR'}, '');
});

const options = {
Expand All @@ -743,7 +743,7 @@ describe('async.js - single POT', () => {
// Check returned array
expect(result).toMatch(new RegExp('PO_MOCK_FS_READFILE_ERROR'));

// Restore the console.log function
// Restore the fs.readFile function
readFileSpy.mockRestore();

done();
Expand Down

0 comments on commit 800d437

Please sign in to comment.