I have a method that takes a file path, and try to open on atom if it is successful. The idea is like this:
@open: (filePath) -> return null unless @goodFilePath(filePath) atom.workspaceView.open(filePath)
So, this returns null when the file is bad, and returns a promise when the file is good. How can I return a failed promise instead of null?
I tried to require
q and use
q.reject, but it is not included directly on atom. Do I need to install it, or should I use promises another way?