@procore/error-pages
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@procore/error-pages

Generic error pages and fallback components

Installation

In a web application, micro frontend or hydra client

yarn add @procore/error-pages

NOTE: Ensure that the following peer dependencies for @procore/error-pages are also installed:

  • @procore/core-react: ^11.4.0
  • react: >=16.8
  • styled-components: ^5.3.0

In a npm package or library

yarn add -P @procore/error-pages^1.0.0 # adds the package as a peer dependency
yarn add -D @procore/error-pages # adds as a dev dependency, for tests, storybook, etc.

NOTE: Ensure that the following peer dependencies for @procore/error-pages are also installed as peer dependencies and as dev dependencies (for tests, storybook, etc.):

  • @procore/core-react: ^11.4.0
  • react: >=16.8
  • styled-components: ^5.3.0

Usage

import { ErrorPage } from '@procore/labs-error-pages';
<ErrorPage title="Error!!" message={<>Error Explanation</>} code={404} />

Components

ErrorPage

Properties

  • title: string or React.ReactChild (required): The title of the error page.
  • code: ErrorCode (optional): the error code for the error, usually represented by a HTTP response code. The code value will be used as a label for the error page and to select an image to display with the error page. The list of error codes below shows the available values.
  • image: React.ComponentType (optional): a custom image component to display instead of the image corresponding with the error code.
  • label: string (optional): An optional label to display on the page. This will be used instead of the label accompanying a error code label.
  • message: string or React.ReactChild (optional): The primary content of the message. Used for providing more information regarding the error.

Supported ErrorCode values:

  • 401: unauthorized
  • 403: forbidden
  • 404: not found
  • 408: request timeout
  • 429: too many requests
  • 500: internal server error
  • 503: service unavailable
  • "ChunkLoadError": special status for chunk load errors from webpack chunks.

Any other value will result in a generic error value and image.

Development

This project uses yarn, and supports the following commands:

  • build: builds and bundles the project.
  • format: runs prettier on the project.
  • format:check: validates that the source code conforms to the prettier configuration.
  • lint: lints the source code.
  • storybook: starts up the storybook development server on port 6006.
  • build-storybook: generates a static version of the storybook.
  • test: runs the unit test suite.
  • test:dev: run the unit test suite in watch mode.

/@procore/error-pages/

    Package Sidebar

    Install

    npm i @procore/error-pages

    Weekly Downloads

    194

    Version

    0.2.0

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    3.8 MB

    Total Files

    26

    Last publish

    Collaborators

    • fernandocamilotti
    • connie-feng-procore
    • roger-procore
    • ganesh.raghupathy
    • yzhou2024
    • alyelashram_procore
    • melch-procore
    • peterknif
    • moaz-ashraf
    • attachi
    • a.elbadawei
    • hyogman
    • dmitri_wm
    • stephanie.brereton
    • procore-oss-user
    • stevenkang3
    • max.helmetag
    • codyrobertsprocore
    • miguel.garcia-procore
    • magdyyx
    • atoaima
    • mustafa-abdelrahman
    • elewando-procore
    • ahmed.ghorab
    • lnspatz914
    • richard.bunn
    • omar.wagdy
    • mona.khairbek
    • mbartlett413
    • cody_schindler_procore
    • yoasyo25
    • ritchlee
    • andersontr15
    • steven.hinkle
    • jamie-dugan-procore
    • hgouhierprocore
    • denzylbalram
    • sarah.freitas
    • alan.bresani
    • amyprocore
    • yoyis3000
    • elijah.procore
    • mike-arndt-procore
    • jnhoang1
    • pam-whisenhunt
    • shradha.khard
    • david-christensen-procore
    • javio-procore
    • chance.eakin.procore
    • gideon-procore
    • ihor.diachenko_procore
    • justinmwatts
    • tedyang
    • jyang-procore
    • pwhisenhunt-procore
    • fairchild
    • rodayna.ehab
    • neil1023
    • scottstern
    • brian.smith1
    • g2mitchell
    • dlameter-procore
    • kylepietz
    • abhijit-procore
    • lhuang325
    • jake-pitkin
    • erikthoreson
    • simona.iancu
    • decha-sanson
    • aberkowitz
    • asamay
    • mustafa-u-abdelrahman
    • rajatmenhdiratta
    • jacksonleach-procore
    • pmfrawley
    • phunguyen-pcor
    • tatsiana.clifton
    • deiab
    • srichaitanya.peddinti
    • kenny.foisy
    • matheusprocore
    • jgreene_procore
    • hectorthiele
    • etokarev
    • daniel.ferreira-contractor
    • dmccraw-procore
    • cyrille.bai
    • greg.sparks
    • fabiomelo513
    • phil.custer
    • bbreyel921
    • amir-iskander
    • neil.mckeeman
    • nickprocore
    • lzhou888
    • davidshure
    • stevenliprocore
    • ramysaid2
    • refaiepcn
    • jgentes
    • faraz.hanif
    • mostafaeltazy
    • agamaleldin
    • andrew.isaac
    • saranahal2
    • rodrigo.dejuana
    • kellen.stewart
    • bill-wagner
    • ezrasimeloff
    • jeffgiaquinto
    • gturkadze
    • sean.spearman.procore
    • kylemartinez-procore
    • roobo-romeski
    • andres-mendez-procore
    • gaurav.sharma.procore
    • tracy.otto
    • sarah.heredia
    • victorbendeck-pc
    • cbathgate
    • davidkangpro
    • kyle.liu
    • amin.jaipuri
    • grafffffff
    • mishaelowoyemi
    • evan.cerwonka.procore
    • ilya.dryha-contractor
    • varomir
    • yogevfine1
    • timofeee
    • matt.harris0223
    • winson.chu
    • andersonbispoprocore
    • scorgiat-procore
    • ladavarga
    • procore_halzy
    • enyaga
    • willpankonien
    • sateesh-kadiyala-procore
    • chris.berber
    • txin1
    • epalinprocore
    • mehrdad-panahandeh
    • tyler.wasden.procore
    • jeremy.lund
    • dineshkumar.jayak
    • ryanfuentesprocore
    • stajics
    • brocktillotsonprocore
    • kyle.williams
    • dtorres-procore
    • noor.ali
    • ari-procore
    • alanprocore
    • jl4ever
    • james.lawson
    • ajaykumar-procore
    • dennis.heckman
    • tara.chambers
    • lalovar-procore
    • james.cleary
    • chadryder
    • devin.cunningham.procore
    • abhijit.patwardhan
    • lydiahara
    • sherylnapigkit
    • changprocore
    • apcarroll_procore
    • andy.mayer
    • bob.laskowski
    • vinaya-procore
    • kahliholmes
    • andrew.wheeler
    • leandro-proc
    • yadhu.prakash
    • jason-kaye
    • jesse.olsen
    • patrick.lardin
    • brad.urani
    • allenanle.procore
    • brookyboy009
    • uddhavjoglekar
    • dancingshell
    • rysmithprocore
    • robbiegprocore
    • jadamsss
    • jeremy.bouzigard
    • timdoherty
    • b.bookout
    • jalyng
    • htael
    • dev-account-admin
    • sseanwang
    • bhargavrnd
    • farismmk
    • dannyporrello
    • danny.ou
    • messanjah
    • eyvettesou
    • jgee67
    • cagmz
    • mariah_delaney
    • lukenispel
    • kimhin267
    • juliana.hernandez
    • judy-lu-pc
    • procore-it-support
    • andrewburke-pc
    • jkleintech
    • rachel.arkebauer
    • procore-npm-bot
    • james.dabbs-procore
    • laurenbrandsteinprocore
    • scottbieser-procore
    • zach.mckenzie.procore
    • shayonj_procore
    • heplayskeys
    • mike.south
    • thomasoboyle
    • dischorde
    • derek-carter-procore
    • dlgasser
    • cfprocore
    • evan.waits
    • jeremy-marcus
    • jmejia-fsl
    • ersgonzalo
    • stephan-procore
    • aleclarsenprocore
    • yihai.zweifel
    • jay-rajan
    • jacky-lei
    • peter.jin