forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
41 lines (34 loc) · 1.2 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export * from '@sentry/node';
import type { Component, JSX } from 'solid-js';
/**
* A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
* so they should simply be a passthrough.
*/
export const ErrorBoundary = (props: { children?: JSX.Element | (() => JSX.Element) }): JSX.Element => {
if (!props.children) {
return null;
}
if (typeof props.children === 'function') {
return props.children();
}
return props.children;
};
/**
* A passthrough store enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
*/
export function createStoreEnhancer() {
return (createStore: unknown) => createStore;
}
/**
* A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
* SSR errors so they should simply be a passthrough.
*/
export function withErrorBoundary<P extends Record<string, unknown>>(WrappedComponent: Component<P>): Component<P> {
return WrappedComponent;
}
/**
* Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
*/
export function showReportDialog(): void {
return;
}