blackbaud / skyux2-docs

Documentation for SKY UX Components
4 stars 32 forks source link

Explain the skyux-host error patterns and it's relationship to the page-level error patterns #1012

Closed Blackbaud-ColbyWhite closed 3 years ago

Blackbaud-ColbyWhite commented 3 years ago

A previous convo illuminated some of the intended use cases around page-level errors, which i attended to summarize as such:

it seems like you have a definition for higher-level and page-level that i wasnt groking since it’s not mentioned in the docs. and it seems like, based on your examples, higher-level means skyux-host level. this is the source of some of the confusion.

skyux-host level (SPA doesnt exist, env-level perm issues, etc) errors will use the errors SPA. page-level errors (myspa/unknownID, etc) should use an err comp within the SPA. this is fair.

with this in mind, the lib makes a lil more sense now. it certainly seems like it’s meant more as a backstop for errors the consumer forgot to catch. and they take the stance of leveraging the errors SPA as a backdrop since that’s what skyux-host does, which seems reasonable in this context.

the docs don't clarify the difference between the two b/c the skyux-host error don't seem to be mentioned. there's three patterns: use the errors SPA, show the error comp on the page and nothing else, and the skyerrormodal (which seems like it should be deprecated, which would be handled via blackbaud/skyux-errors#38). then there's a lib that currently uses two of those patterns, but should probably only use one for a specific use case. most of this is missing from a doc.

Blackbaud-SteveBrush commented 3 years ago

The error SPA should never be used by a SKY UX consumer; it's used internally by SKY UX Builder/Host for 404s or invalid routes. The use cases for the component and error modal will be described in the developer docs; see: https://github.com/blackbaud/skyux-errors/issues/41

Blackbaud-ColbyWhite commented 3 years ago

The error SPA should never be used by a SKY UX consumer

that makes sense. but why not document/clarify that that is something you are getting for free as a SKY UX consumer? otherwise, when the SPA magically redirects to the error SPA, it comes as a shock. that may not be a big deal in a grand scheme b/c im assuming every dev in that moment thinks to themselves "well, i guess that's what it's supposed to do" and then moves on, but the fact that we have a library that mimics the behaviour and we aren't sure if it should be mimicking the behaviour in the correct scenario proves that this scenario isn't clear. one paragraph somewhere explaining that SKY UX handles a certain set of errors for you and a sentence as to why would clear up the confusion.