Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error class wrappers #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ utils.restoreDatabase = (connectionString, dirName, next) ->
return next null, stdOut, stdErr

utils.makeDumpCommand = (connectionString, dirName) ->
throw "No target directory given." unless dirName
throw "Target directory must be a string" unless typeof dirName is "string"
throw new Error "No target directory given." unless dirName
throw new Error "Target directory must be a string" unless typeof dirName is "string"
connectionParameters = utils.parseConnectionString connectionString
commandOptions = makeCommandOptions connectionParameters
commandOptions.out = dirName
Expand All @@ -54,8 +54,8 @@ utils.makeDumpCommand = (connectionString, dirName) ->
"mongodump#{argumentString}"

utils.makeRestoreCommand = (connectionString, dirName) ->
throw "No source directory given." unless dirName
throw "Source directory must be a string" unless typeof dirName is "string"
throw new Error "No source directory given." unless dirName
throw new Error "Source directory must be a string" unless typeof dirName is "string"
actualDirName = utils.findDumpDirName dirName
utils.log "Using #{actualDirName}"
connectionParameters = utils.parseConnectionString connectionString
Expand Down Expand Up @@ -122,4 +122,4 @@ makeCommandArguments = (options, object) ->
makeArgumentString = (args) ->
str = ""
str += " '#{arg}'" for arg in args
str
str