Skip to content

Commit

Permalink
feat(MongoInstance::checkErrorInLine): dont remove ", terminating" fr…
Browse files Browse the repository at this point in the history
…om error

fixes #664

BREAKING CHANGE:
potentially breaking change not removing ", terminating" from error
  • Loading branch information
hasezoey committed Aug 17, 2022
1 parent ca75ef5 commit 793aa0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,7 @@ export class MongoInstance extends EventEmitter implements ManagerBase {
MongoInstanceEvents.instanceError,
new StdoutInstanceError(
`Instance Failed to start with "${execptionMatch[1] ?? 'unknown'}". Original Error:\n` +
line
.substring(execptionMatch.index + execptionMatch[0].length)
.replace(/, terminating$/gi, '')
line.substring(execptionMatch.index + execptionMatch[0].length)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ exports[`MongodbInstance test events checkErrorInLine() should emit "instanceErr

exports[`MongodbInstance test events stdoutHandler() should emit "instanceError" when "excepetion in initAndListen" is thrown DbPathInUse (Not a directory) 1`] = `
"Instance Failed to start with \\"DBPathInUse\\". Original Error:
Unable to create/open the lock file: /dev/null/mongod.lock (Not a directory). Ensure the user executing mongod is the owner of the lock file and has the appropriate permissions. Also make sure that another mongod instance is not already running on the /dev/null directory"
Unable to create/open the lock file: /dev/null/mongod.lock (Not a directory). Ensure the user executing mongod is the owner of the lock file and has the appropriate permissions. Also make sure that another mongod instance is not already running on the /dev/null directory, terminating"
`;

exports[`MongodbInstance test events stdoutHandler() should emit "instanceError" when "excepetion in initAndListen" is thrown DbPathInUse (already running) 1`] = `
"Instance Failed to start with \\"DBPathInUse\\". Original Error:
Unable to lock the lock file: /tmp/hellodb/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /tmp/hellodb directory"
Unable to lock the lock file: /tmp/hellodb/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /tmp/hellodb directory, terminating"
`;

exports[`MongodbInstance test events stdoutHandler() should emit "instanceError" when "excepetion in initAndListen" is thrown Location28596 1`] = `
"Instance Failed to start with \\"Location28596\\". Original Error:
Unable to determine status of lock file in the data directory /root: boost::filesystem::status: Permission denied: \\"/root/mongod.lock\\""
Unable to determine status of lock file in the data directory /root: boost::filesystem::status: Permission denied: \\"/root/mongod.lock\\", terminating"
`;

exports[`MongodbInstance test events stdoutHandler() should emit "instanceError" when "excepetion in initAndListen" is thrown NonExistentPath 1`] = `
"Instance Failed to start with \\"NonExistentPath\\". Original Error:
Data directory /tmp/hello not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."
Data directory /tmp/hello not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating"
`;

exports[`MongodbInstance test events stdoutHandler() should emit "instanceError" when curl-open-ssl-3 is not found 1`] = `
Expand Down

0 comments on commit 793aa0d

Please sign in to comment.