-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
9,728 additions
and
24,993 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types'; | ||
import React from 'react' | ||
import { DefaultErrorComponentProps } from './types'; | ||
|
||
export interface DefaultErrorComponentProps { | ||
error: Error | null | ||
info: React.ErrorInfo | null | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
export default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> { | ||
|
||
static propTypes = { | ||
error: PropTypes.object, | ||
info: PropTypes.object | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className='error'> | ||
<div> | ||
An Error Occurred | ||
</div> | ||
<div> | ||
{JSON.stringify(this.props.error, null, 2)} | ||
</div> | ||
<div> | ||
{this.props.info ? JSON.stringify(this.props.info, null, 2) : ''} | ||
</div> | ||
function DefaultErrorComponent({ error, info }: DefaultErrorComponentProps) { | ||
return ( | ||
<div className='error'> | ||
<div> | ||
An Error Occurred | ||
</div> | ||
) | ||
} | ||
<div> | ||
{JSON.stringify(error, null, 2)} | ||
</div> | ||
<div> | ||
{info ? JSON.stringify(info, null, 2) : ''} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default DefaultErrorComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ComponentType, ElementType, ErrorInfo, PropsWithChildren, ReactNode } from 'react'; | ||
import Honeybadger from '@honeybadger-io/js'; | ||
|
||
export type DefaultErrorComponentProps = { | ||
error: Error | null | ||
info: ErrorInfo | null | ||
} | ||
|
||
export type HoneybadgerErrorBoundaryProps = PropsWithChildren<{ | ||
honeybadger: typeof Honeybadger | ||
showUserFeedbackFormOnError?: boolean | ||
ErrorComponent?: ReactNode | ComponentType | ElementType | ||
}> | ||
|
||
export type HoneybadgerErrorBoundaryState = { | ||
errorOccurred: boolean | ||
} & DefaultErrorComponentProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,8 @@ | |
"node_modules" | ||
], | ||
"include": [ | ||
"./src/*.tsx" | ||
"./src/*.tsx", | ||
"./src/*.ts" | ||
], | ||
"references": [ | ||
{ | ||
|