mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-01-02 13:33:06 +00:00
Use sentry for production only
This commit is contained in:
parent
5c8eee11d8
commit
ac1a357d1e
@ -24,7 +24,9 @@ export class ErrorBoundary extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, info: ErrorInfo) {
|
||||
Sentry.captureException(error);
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.captureException(error);
|
||||
}
|
||||
console.error(error, info);
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,9 @@ export function LogLevel() {
|
||||
queryClient.invalidateQueries({ queryKey: ["debug"] });
|
||||
},
|
||||
onError: (error) => {
|
||||
Sentry.captureException(error);
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.captureException(error);
|
||||
}
|
||||
|
||||
setToast({
|
||||
message: "Error when trying to update: " + error,
|
||||
|
||||
@ -294,7 +294,9 @@ export function StorageRequestReview({ onChangeNextState }: Props) {
|
||||
<CardNumbers
|
||||
title={"Proof probability"}
|
||||
data={data.proofProbability.toString()}
|
||||
comment={errors.proofProbability || "Proof request frequency"}
|
||||
comment={
|
||||
errors.proofProbability || "Proof request frequency in seconds"
|
||||
}
|
||||
onChange={onProofProbabilityChange}
|
||||
hasError={!!errors.proofProbability}></CardNumbers>
|
||||
</div>
|
||||
|
||||
@ -66,7 +66,9 @@ export function StorageRequestStepper({ className, open, onClose }: Props) {
|
||||
PurchaseStorage.set(requestId, cid);
|
||||
},
|
||||
onError: (error) => {
|
||||
Sentry.captureException(error);
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.captureException(error);
|
||||
}
|
||||
|
||||
setToast({
|
||||
message: "Error when trying to update: " + error,
|
||||
@ -117,6 +119,7 @@ export function StorageRequestStepper({ className, open, onClose }: Props) {
|
||||
setProgress(false);
|
||||
|
||||
if (s >= steps.current.length) {
|
||||
console.info("delete");
|
||||
setStep(0);
|
||||
WebStorage.delete("storage-request-step");
|
||||
WebStorage.delete("storage-request-criteria");
|
||||
|
||||
@ -10,7 +10,9 @@ export function useData() {
|
||||
const res = await data.cids();
|
||||
|
||||
if (res.error) {
|
||||
Sentry.captureException(res.data);
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.captureException(res.data);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,9 @@ import * as Sentry from "@sentry/browser";
|
||||
export const Promises = {
|
||||
rejectOnError: <T>(safe: SafeValue<T>) => {
|
||||
if (safe.error) {
|
||||
Sentry.captureException(safe.data);
|
||||
if (import.meta.env.PROD) {
|
||||
Sentry.captureException(safe.data);
|
||||
}
|
||||
return Promise.reject(safe.data);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user