-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include missing paths in MaxRetryExceededError instances #874
Conversation
this will help developers understand data source and service failures better
lib/errors/MaxRetryExceededError.js
Outdated
this.message = "The allowed number of retries have been exceeded."; | ||
this.missingPaths = missingPaths || []; | ||
this.stack = (new Error()).stack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're in the client this may not be possible, but is there something like captureStackTrace
available across different browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remain cross platform I think (new Error()).stack
is the best that can be done here.
@@ -12,17 +12,18 @@ var MaxRetryExceededError = require("./../../errors/MaxRetryExceededError"); | |||
*/ | |||
module.exports = function setRequestCycle(model, observer, groups, | |||
isJSONGraph, isProgressive, count) { | |||
var requestedAndOptimizedPaths = setGroupsIntoCache(model, groups); | |||
var optimizedPaths = requestedAndOptimizedPaths.optimizedPaths; | |||
var requestedPaths = requestedAndOptimizedPaths.requestedPaths; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to consider which could be a little scary: we're going from conditionally setting groups into cache, to always setting. It might be that the shape of what is set makes this inconsequential, but could be worth a close look before you merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion with Jafar and Steve, it seems logical to add any potential results returned from server into cache, even if it was on the last retried request.
Good catch though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from being paranoid about setGroupsIntoCache changes, LGTM.
instead of missingPaths (requested)
and better tests for get
LGTM |
this will help developers understand data source and service failures better