-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
runTimeError exists when there are NO_ERRORs #6336
Comments
I'm missing rationale for this too. In #6014, @brendankenny said
Which makes a lot of sense to me too. Why did we not go that route? :) |
+1 just to echo that, it was unclear in our tool that consumes lhrs that
the results we were saving were actually illegitimate. And you almost never
want a psuedo real result... doesn't tell you much :)
…On Thu, Oct 18, 2018, 7:22 AM Patrick Hulce ***@***.*** wrote:
I'm missing rationale for this too.
In #6014 <#6014>,
@brendankenny <https://github.com/brendankenny> said
I'd prefer to continue throwing exceptions for these cases and then
checking outside core in runLighthouseForLR that the thrown error has
lhrRuntimeError set on it. Most of our clients just want a thrown error in
those cases, not a pseudo-LHR, and dealing with a pseudo-LHR just makes
tracking the LHR type and what's on it messier when we really just want an
exception floated up.
Which makes a lot of sense to me too. Why did we not go that route? :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6336 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOigLmtwoXJdG_0ePFjYY-LTJKaA5k5ks5umI6JgaJpZM4XsuU0>
.
|
This has implications for proto enums as well. @paulirish |
#6330 is also part of this |
runtimeError for failed document requests@ebidel currently in the case of a 500 or a DNS resolving error for the page being tested, we do return an LHR with a populated On throwing and pseudo-LHRsI'm not sold that throwing to our node module consumers is useful, but we can leave that be. I'll live with our current approach. However, for CLI users (and I'm mostly considering CLI use at scale here), I don't think communicating over exit code is tremendously effective. In order to convey any detail about the error we'd need to log something, but that now means the user has to parse stderr, which we've been logging status to this whole time. :/ So I'd argue that CLI users would be better served with a psuedo-LHR with the NO_ERRORSounds like nobody likes API flexibilityLast, we need to confirm what we can do on the PSI API side of things. We don't have unlimited flexibility there, but after discussing it, @exterkamp thinks we can probably handle this well. But whatever the plan is, it needs to be compatible there, because those LHRs will be consumed more than LHRs from the CLI. ;) |
😮 I am so curious why, but I'll table that for now too :) Thanks for the context!
I can understand getting more information about the error is more difficult in the CLI case, but I'm curious who those CLI users are where getting the error string easily is more important than detecting that an error happened easily. I would expect that the only actionable information it gives anyone not on this team is that they need to re-run LH. From bash script angle, being able to tell LH failed just by exit code is a huge win over parsing JSON and checking if a specific property is equal to a particular value to figure out there was a failure. This also assumes they're not using the CLI to generate HTML output in which case determining there was an error seems impossibly difficult. Are we at least considering doing both? Populating a JSON
I should've known proto was to blame :) does this mean it's the default and won't be set in the API response? I forget where we landed on if our proto-version does that.
I probably missed this, but do our error responses and the LHR have to be same proto? In my experience, it's very common for error responses with a non-200 status to have very different schemas. |
In fact, I think that's what a lot of Google service APIs do. The return object is something like |
A few updates:
|
Yes we'd def still set an exit code correctly. Current status is...
I believe this reflects the consensus. AFAICT, node module + API behavior are settled, but we have some unresolved questions around CLI behavior. |
I will try to organize this a little bit so that we don't get out of hand with #6671. Error DefinitionsIt seems like there are two main kinds of Lighthouse errors:
Error ActionsAs noted in this convo, surfacing these runtime errors can be a problem. This seems like the consensus.
PSIPSI should return an HTTP status code that is consistent with the LHR inside it. Currently it will return a 200 if there is a response from LR, even if that response is that a runtime error has occured. This is not desired and should return 200 if successful (no runtimeErrors or runtimeWarnings) and a 5XX if the run was not successful. Also PSI shouldn't mirror what LR encountered e.g. if Lightrider gets a 404 PSI should return a 5XX not a 404. This does make me want a better way to show that there was an underlying status code/details to the error. After #6457 the error codes will have some more explicit status codes appended to them, but it might be prudent to add a field to Lighthouse_result.runtime_error something like Eng to make this happen
|
Thanks for the clarification @exterkamp this helps quite a bit!! Few Qs
We're missing The CLI, LR, and PSI end-behavior all sound great, but given that an error is just an object, can we just attach whatever additional information to it we need?
This isn't really the case for every pass, some passes it's OK for PageLoadError to just be a gatherer error, and move on and in fact is why we converted it from a fatal error to a non-fatal error. Is the core of what we're getting at here when the root document of the default pass errors we want the run to stop and produce a runtimeError? Because that seems like a more specific problem than all
I think a hurdle for me is the idea that you get an "LHR" when there's a fatal runtimeError. WDYT if we treated it exactly like we want the PSI API to work, you don't get back an LHR but an error response with details. I think the fact that you get an LHR is one of the hurdles of the original issue filing and if the node module instead returned an object like |
So @patrickhulce response made me look more into the LR errors, and I finally found the root cause (#6739)! So I am going to table more advanced error handling (#6671) for later. But I definitely think that PSI error handling needs to be re-evaluated next, but I'm going to leave LH CLI, node and others for later. |
Okay picking this back up. Current state of affairs:
This is the result of the proto definition for Lighthouse Errors using NO_ERROR as the default enum of 0, therefore in proto3 they are left blank since it is the default. Are we satisfied with this outcome? Do we also want to remove NO_ERRORs from the LHR by default (I think the main reason they were there in the beginning was PSI, which doesn't need them anymore). Generating a set of, what I'm still going to call |
I'm not really satisfied with the node outcome right now. Eliminating the I think I still stand by my opinions/suggestions in #6336 (comment), so good to see a few months hasn't changed me too much :) |
I thought this would be the answer 😉 I'll work on refactoring the node to have no |
@exterkamp follow up pr for exit code (#7358 (comment)) then we can close this issue? |
Yup afaict I think this is 💯 |
Ran into this working on a web server that returns LH results. It's unexpected that
runTimeErrors
exists in the LHR if there were no errors! It also requires users to check for a "NO_ERROR" string code which overcomplicates matters.Environment Information
The text was updated successfully, but these errors were encountered: