I'm afraid I can't help you much, because my knowledge about
promises is more theoretical than practical.

The 3 lines of code you posted look just fine. The cause of the
behaviour you've mentioned must lie somewhere else in your
code.
Try to reduce the complexity of your code. Start with a very basic
example. Questions to ask yourself:
Are you making multiple calls to the server? Are you using some
callback functions?
Are you nesting the remote calls? Are you using more than one
promise?
Are you sure the error handler is called for the same promise?
The error you're receiving should give you some hints about the
origin of the problem, like what happens on your backend
server...
What happens if you don't use promises, does the server respond as
expected?