throwError = (errorName)->
	throw new Error 'SimplyBind: '+(errors[errorName] or errorName)

throwWarning = (warningName, depth)-> unless settings.silent
	errSource = getErrSource(depth)
	warn = errors[warningName]
	warn += "\n\n"+errSource
	console.warn('SimplyBind: '+warn)
	return

throwErrorBadArg = (arg)->
	throwError "Invalid argument/s (#{arg})", true
	return

getErrSource = (depth)->
	((new Error).stack or '')
		.split('\n')
		.slice(depth+3)
		.join('\n')


