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