Skip to content

Commit

Permalink
Wrap error strings with Error class
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Mar 31, 2011
1 parent 870a267 commit c11c113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/stitch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/stitch.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exports.Package = class Package
base = expandedPath + "/"
if sourcePath.indexOf(base) is 0
return callback null, sourcePath.slice base.length
callback "#{path} isn't in the require path"
callback new Error "#{path} isn't in the require path"

compileFile: (path, callback) ->
extension = extname(path).slice(1)
Expand All @@ -196,7 +196,7 @@ exports.Package = class Package
err = new Error "can't compile #{path}\n#{err}"
callback err
else
callback "no compiler for '.#{extension}' files"
callback new Error "no compiler for '.#{extension}' files"

walkTree: (directory, callback) ->
fs.readdir directory, (err, files) =>
Expand Down

0 comments on commit c11c113

Please sign in to comment.