question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Status is undefined in case of 413 error

See original GitHub issue
Request.prototype.callback = function(err, res){
  if (this._shouldRetry(err, res)) {
    return this._retry();
  }

  var fn = this._callback;
  this.clearTimeout();

  if (err) {
    if (this._maxRetries) err.retries = this._retries - 1;
    this.emit('error', err); <==== break point is here
  }

  fn(err, res);
};

err: Error: Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc. at Request.crossDomainError (webpack:///../node_modules/superagent/lib/client.js?:621:13) at XMLHttpRequest.xhr.onreadystatechange (webpack:///../node_modules/superagent/lib/client.js?:703:19)
crossDomain
:
true
method
:
"POST"
status
:
undefined

so on error callback I can’t detect status…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kornelskicommented, Sep 3, 2018

If you see status == 0 that’s a CORS (security) violation from browser’s perspective. The response contains data that the browser wants to keep secret. This cannot be fixed in superagent. The browser refuses to expose information about this error.

0reactions
niftylettucecommented, Jun 6, 2019

PR welcome

Read more comments on GitHub >

github_iconTop Results From Across the Web

Status is undefined in case of 413 error · Issue #1397 - GitHub
The response contains data that the browser wants to keep secret. This cannot be fixed in superagent. The browser refuses to expose information ......
Read more >
How to Solve the "413 Request Entity Too Large" Error - Kinsta
Are you experiencing the "413 Request Entity Too Large" error? In this article, learn how to resolve this error!
Read more >
{"error":{"code":413,"message":"request entity too large"}}
This error will occur when the request body's size is larger than the "limit" option. The limit property will be set to the...
Read more >
What Is a 413 Request Entity Too Large Error & How to Fix It
A 413 HTTP error code occurs when the size of a client's request exceeds the server's file size limit. This typically happens when...
Read more >
413 Request Entity Too Large - TooBigBody | Apigee Edge
This error occurs if the payload size sent by the client application to Apigee Edge as part of HTTP request is greater than...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found