Skip to content

Commit

Permalink
Make sure that we have a correct stack trace during async rendering i…
Browse files Browse the repository at this point in the history
…n dev
  • Loading branch information
cc-ebay committed Nov 15, 2019
1 parent 0414fe8 commit 81dad30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core-tags/core/await/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ function requestData(provider, timeout) {
timeout = 10000;
}

var error;
if ("MARKO_DEBUG") {
// Make sure we have a significant stack trace in development
error = new Error("Timed out after " + timeout + "ms");
}
if (timeout > 0) {
let timeoutId = setTimeout(function() {
timeoutId = null;
var error = new Error("Timed out after " + timeout + "ms");
if (!error) error = new Error("Timed out after " + timeout + "ms");
error.code = "ERR_AWAIT_TIMEDOUT";
error.name = "TimeoutError";
asyncValue.___reject(error);
Expand Down

0 comments on commit 81dad30

Please sign in to comment.