Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

feat: improved error messaging functionality #517

Merged
merged 6 commits into from
Mar 11, 2020

Conversation

erunion
Copy link
Member

@erunion erunion commented Mar 11, 2020

🌱 Changes

  • Adds a new maskErrorMessages flag on the Doc component that will let us toggle error messages between a consumer-friendly version, and one more targeted to ReadMe project owners.
  • Introduces a new onError handler to Doc that will get run whenever an error happens within the Explorer. We can use this to hook it up Explorer error reporting to Sentry! Currently onError is expected to return an event identifier (like the README-G ids we have in Sentry) which it'll then use to display that as an error code in the frontend for project owners if they wish to contact us.
  • Added a new checkbox to the demo build that will allow us to easily cycle through these different messaging states.

🎨 Designs

Designs can be found in Figma under "Amy 20% Project".

⚙ Testing

You can test the error state out on http://localhost:9966/?selected=swagger-files%2Fendpoint-error-boundary.json

To cycle through the different masked states click on the "Mask error message" checkbox:

Screen Shot 2020-03-11 at 3 58 52 PM

To trigger the complete explorer failure state, click "Show fully broken state":

Screen Shot 2020-03-11 at 3 59 27 PM

@erunion erunion added the type:enhancement A potential new feature to be added, or an improvement we could make label Mar 11, 2020
@erunion
Copy link
Member Author

erunion commented Mar 11, 2020

@rafegoldberg For the consumer view, I talked with @amyshi188 and it might be best if the error message extends the full width of the box since there's no error code.

@rafegoldberg
Copy link
Contributor

rafegoldberg commented Mar 11, 2020

Added styling:

User View

image

Admin View (with error code)

image

@rafegoldberg rafegoldberg temporarily deployed to api-explorer-feat-impro-gxbtvg March 11, 2020 19:56 Inactive
@rafegoldberg rafegoldberg temporarily deployed to api-explorer-feat-impro-gxbtvg March 11, 2020 20:15 Inactive
@rafegoldberg rafegoldberg temporarily deployed to api-explorer-feat-impro-gxbtvg March 11, 2020 22:53 Inactive
@erunion erunion marked this pull request as ready for review March 11, 2020 22:53
@erunion
Copy link
Member Author

erunion commented Mar 11, 2020

Migrated the new error capturing work up to our complete API Explorer failure handling code:

Screen Shot 2020-03-11 at 3 53 26 PM

Screen Shot 2020-03-11 at 3 53 29 PM

These are the messages that'll appear on projects where the explorer is completely broken.

@erunion erunion merged commit f5794bf into feat/mainline-rjsf Mar 11, 2020
@erunion erunion deleted the feat/improved-error-messaging branch March 11, 2020 23:00
erunion added a commit that referenced this pull request Mar 13, 2020
#436)

* feat: moving react-jsonschema-form off our fork and to the mainline pkg

* docs: wip updates to the allOf example definition

* chore(deps): pointing rjsf towards our new soft fork

* test: updating our allOf example document

* feat: adding support for `format: blob` to render a string textarea

* feat: adding support for rendering a textarea on `format: html`

* fix: html and blob formats now have the right format pill next to them

* chore: re-running npm install to fix some dep merge issues

* chore(deps): upgrading @readme/react-jsonschema-form to 1.1.0

* test: cleanup on the github workflow

* test: workflow updates

* test: reverting workflow changes

* docs: merging our three polymorphism example docs into a single file

* fix: fixing a bug where long flattened response bodies would be hidden

* docs: adding a comment in the SchemaField explaining bool handling

* fix: updating word wrapping on response schemas

* chore: minor cleanup of the root package file

* chore: updating package-lock files

* test: moving test fixtures into a __fixtures__ directory

* test: resolving some broken Doc tests

* docs: removing some duplicated properties from the oas fixture

* test: fixing some broken custom string format tests

* fix: adding support for being able to handle escaped refs

* test: dumping jest-transform-css for another library to fix css issues in jest tests

* test: fixing some broken tests

* test: making sure to run `npm run update:examples` before tests

* chore(deps): upgrading @readme/oas-tooling to 3.0.0

* test: fixing a comment

* fix: removing some hokey environment checks for scss loading

* fix: wrapping oneOf and anyOf schemas in a custom template shell

* test: fixing a busted Doc test

* fix: if an operation doesn't have an operationId, generate a unique one

* docs: adding a cyclical refs example document

* fix: patching a bug where we couldn't handle nested $refs in oneOf

resolves https://github.com/readmeio/api-explorer/issues/495

* chore(deps): upgrading @readme/react-jsonschema-form to 1.1.1

* feat: improved error messaging functionality (#517)

* feat: wip of improved error messaging functionality

* style(EndpointErrorBoundary)

* feat: adding a checkbox to toggle error masking in the demo build

* test: fixing broken tests

* feat: consolidating our multiple error boundary components into one

Co-authored-by: Rafe Goldberg <rafegoldberg@gmail.com>

* docs: updating the readme

* style: autoprefix scss

...just in case

* chore: updating lock files post-bootstrap

* fix: cleaning up the new "experiment" options in the demo build

* feat: adding a new experiment toggle for the new markdown engine

* fix: adding back a form id that i renamed/fixed

* fix: stop generating random ids when an operationId isn't present

* fix: renaming `onGroupChange` to `onAuthGroupChange`

Co-authored-by: Rafe Goldberg <rafegoldberg@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:enhancement A potential new feature to be added, or an improvement we could make
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants