The server returned an empty string for GET
See original GitHub issueOur server is not something we can modify, and seems to return an empty string for a get with a certain EndPoint. Whilst this only shows in the console as an error, an exception is thrown which causes execution to skip through our catch block.
Everything works ok, the backend performs the work and returns as it always does, however I need a better way to handle and parse this error. Any suggestions?
this.get('ajax').request('/users/restorepassword/' + this.get('username'), {})
.then(function() {
_this.set('infoMessage', 'Please check your email!');
_this.set('errorMessage', '');
})
.catch(function(error) {
// Execution reaches here, everything is ok, the server returns 200 (with an empty string)
_this.set('infoMessage', '');
_this.set('errorMessage', error);
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Express server returns empty string as a response for proxied ...
The server fetches and logs the expected data. But the frontend logs empty string despite the backend returning the exact data logged.
Read more >GETPATHINFO() RETURNS EMPTY STRING INSTEAD ... - IBM
User has servlet that uses method getPathInfo(). According to the Servlet Spec 2.3, it should either return a string with a leading slash...
Read more >empty - Manual - PHP
Returns true if var does not exist or has a value that is empty or equal to zero, ... $b==(int)$c -> true, because...
Read more >Request.ServerVariables() returns empty - ASP.NET
If you try to access the Request.ServerVariables("LOGON_USER") variable in ASP.NET, an empty string is returned. If you are using Microsoft ...
Read more >Why is my client server program only returning empty lines ...
Note, you do not need to send any data to the server, just receive from it. ... ok wow. that is exactly what...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ezekg, I had the same problem and adding
dataType: 'text'
to post method fixed the errorI’m seeing this issue as well. API is responding with 202 no content but it’s still trying to parse the response as JSON. Having to do this as a workaround: