I have a scenario where I am returning a promise. The promise is basically triggered by an ajax request.
On rejecting the promise it shows an error dialog that there
It works and isn't really a problem, except when a caller of makeRequest expects of promise to fulfil. So, you're breaking the contract there.
makeRequest
Instead, you could defer the promise, or (in this case) reject with status code/error.