Error Summary

Highlights one or more server errors, either due to exceptional circumstances or form validation issues.

Installation

import { ErrorSummary } from "@octopusdeploy/design-system-components"

Properties

Using the ErrorSummary component

Avoid using ErrorSummary directly. You'd only reach for it when you already have an error in hand to display, and that's uncommon, because errors normally flow from core infrastructure (network requests and form validation) and surface automatically through dedicated slots in "container" components such as layouts, pages, drawers, and dialogs.

If you're working with Octopus Server, you should almost never need to use ErrorSummary directly.

Error Mapping

If you have an error that isn’t being automatically handled by infrastructure, then you likely have an error with a different kind of a different shape than what this component expects, which will require your errors to be mapped to the appropriate format. The error prop for this component caters for two specific scenarios:

  • An error with a title and a description with optional help with a link
  • A validation error with a custom title with the details of those items that failed validation with optional help with a link

                                                        
                                                        
                                                            function MyComponent(props){
                                                            const { error: infrastructureError } = useHookWithError();
                                                            const error = mapError(infrastructureError);
                                                        
                                                            return <RootComponent>
                                                                <ErrorSummary error={error} />
                                                            </RootComponent>
                                                        }