Unverified Commit 31bb5b85 authored by benguedj's avatar benguedj Committed by GitHub
Browse files

fix: 馃悰 Corrige le report des erreurs sur Sentry (#562)

parent 2b754e8c
......@@ -22,7 +22,8 @@ export default {
config: {
authToken: process.env.SENTRY_TOKEN,
organization: "incubateur",
project: "1000-premiers-jours",
project: "nos-1000-jours",
url: "https://sentry.fabrique.social.gouv.fr",
},
file: "sentry-expo/upload-sourcemaps",
},
......
......@@ -32,11 +32,14 @@ const ErrorMessage: React.FC<Props> = ({ error }) => {
setFetchIsComplete(false);
try {
reportError(
`${Labels.errorMsg} : ${apolloError.message} (Stacktrace : ${apolloError.stack})`
);
const response = await fetch(
`${process.env.API_URL}/.well-known/apollo/server-health`,
{ cache: "no-cache" }
);
reportError(`${Labels.errorMsg} : ${apolloError.message}`);
let responseJson = null;
......
......@@ -37,16 +37,19 @@
"babel-plugin-inline-dotenv": "^1.6.0",
"date-fns": "^2.22.1",
"expo": "^41.0.1",
"expo-application": "~3.1.2",
"expo-asset": "~8.3.2",
"expo-asset-utils": "^2.0.0",
"expo-cli": "^4.7.3",
"expo-constants": "~10.1.3",
"expo-device": "~3.2.0",
"expo-font": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-location": "~12.0.4",
"expo-notifications": "^0.11.6",
"expo-splash-screen": "~0.10.3",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.5.4",
"expo-web-browser": "~9.1.0",
"graphql": "^15.5.1",
"lodash": "^4.17.21",
......
import * as Sentry from "sentry-expo";
import { Native } from "sentry-expo";
export const initMonitoring = (): void => {
const enabled = process.env.SENTRY_ENABLED !== "false";
......@@ -12,5 +13,5 @@ export const initMonitoring = (): void => {
// Throwing an error will trigger Sentry
export const reportError = (errorMessage: string | undefined): void => {
throw new Error(errorMessage);
Native.captureException(errorMessage);
};
......@@ -1507,7 +1507,7 @@
getenv "^1.0.0"
metro-react-native-babel-transformer "^0.59.0"
"@expo/metro-config@^0.1.16", "@expo/metro-config@^0.1.63", "@expo/metro-config@^0.1.80":
"@expo/metro-config@^0.1.16", "@expo/metro-config@^0.1.59", "@expo/metro-config@^0.1.63", "@expo/metro-config@^0.1.80":
version "0.1.80"
resolved "https://registry.yarnpkg.com/@expo/metro-config/-/metro-config-0.1.80.tgz#289ee83b815aeb2a772d2bf0d8bb0c0dd4b7082b"
integrity sha512-A2jFV4XWNaT/LR7oKkLMFbCNTpI7JWCbns1mmhjA3zKf8k03Kj2mLEoJMI17JtLtz0WuH9hvqr5OuaK7jlmegQ==
......@@ -2613,19 +2613,19 @@
tslib "^1.9.3"
"@sentry/browser@^6.2.0":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.7.2.tgz#cfbe060de5a9694617f175a6bde469e5e266792e"
integrity sha512-Lv0Ne1QcesyGAhVcQDfQa3hDPR/MhPSDTMg3xFi+LxqztchVc4w/ynzR0wCZFb8KIHpTj5SpJHfxpDhXYMtS9g==
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.10.0.tgz#92e72edca584d940fba80cf6477d4a54c6dea573"
integrity sha512-H0Blgp8f8bomebkkGWIgxHVjabtQAlsKJDiFXBg7gIc75YcarRxwH0R3hMog1/h8mmv4CGGUsy5ljYW6jsNnvA==
dependencies:
"@sentry/core" "6.7.2"
"@sentry/types" "6.7.2"
"@sentry/utils" "6.7.2"
"@sentry/core" "6.10.0"
"@sentry/types" "6.10.0"
"@sentry/utils" "6.10.0"
tslib "^1.9.3"
"@sentry/cli@^1.52.4":
version "1.66.0"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.66.0.tgz#0526f1bc1c0570ce72ed817190af92f3b63a2e9a"
integrity sha512-2pZ+JHnvKqwyJWcGkKg/gCM/zURYronAnruBNllI+rH2g5IL0N90deMmjB1xcqXS66J222+MPTtWrGEK1Vl0/w==
version "1.67.2"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.67.2.tgz#dbb5631cb3637e10298f67915013592cb22f04ff"
integrity sha512-lPn0Sffbjg2UmCkHl2iw8pKlqpPhy85mW0za5kz3LEqC9JGUXHo9eSyyCkiRktlemMXKk+DeS/nyFy/LTRUG2Q==
dependencies:
https-proxy-agent "^5.0.0"
mkdirp "^0.5.5"
......@@ -2634,6 +2634,17 @@
progress "^2.0.3"
proxy-from-env "^1.1.0"
"@sentry/core@6.10.0":
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.10.0.tgz#70af9dc72bb6a5b59062a31b7de023f7f1878357"
integrity sha512-5KlxHJlbD7AMo+b9pMGkjxUOfMILtsqCtGgI7DMvZNfEkdohO8QgUY+hPqr540kmwArFS91ipQYWhqzGaOhM3Q==
dependencies:
"@sentry/hub" "6.10.0"
"@sentry/minimal" "6.10.0"
"@sentry/types" "6.10.0"
"@sentry/utils" "6.10.0"
tslib "^1.9.3"
"@sentry/core@6.7.1":
version "6.7.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.7.1.tgz#c3aaa6415d06bec65ac446b13b84f073805633e3"
......@@ -2645,15 +2656,13 @@
"@sentry/utils" "6.7.1"
tslib "^1.9.3"
"@sentry/core@6.7.2":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.7.2.tgz#1d294fac6e62744bce3b9dfbcd90b14e93620480"
integrity sha512-NTZqwN5nR94yrXmSfekoPs1mIFuKvf8esdIW/DadwSKWAdLJwQTJY9xK/8PQv+SEzd7wiitPAx+mCw2By1xiNQ==
"@sentry/hub@6.10.0":
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.10.0.tgz#d59be18016426fd3a5e8d38712c2080466aafe3c"
integrity sha512-MV8wjhWiFAXZAhmj7Ef5QdBr2IF93u8xXiIo2J+dRZ7eVa4/ZszoUiDbhUcl/TPxczaw4oW2a6tINBNFLzXiig==
dependencies:
"@sentry/hub" "6.7.2"
"@sentry/minimal" "6.7.2"
"@sentry/types" "6.7.2"
"@sentry/utils" "6.7.2"
"@sentry/types" "6.10.0"
"@sentry/utils" "6.10.0"
tslib "^1.9.3"
"@sentry/hub@6.7.1":
......@@ -2665,15 +2674,6 @@
"@sentry/utils" "6.7.1"
tslib "^1.9.3"
"@sentry/hub@6.7.2":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.7.2.tgz#31b250e74aa303877620dfa500aa89e4411e2dec"
integrity sha512-05qVW6ymChJsXag4+fYCQokW3AcABIgcqrVYZUBf6GMU/Gbz5SJqpV7y1+njwWvnPZydMncP9LaDVpMKbE7UYQ==
dependencies:
"@sentry/types" "6.7.2"
"@sentry/utils" "6.7.2"
tslib "^1.9.3"
"@sentry/integrations@6.7.1":
version "6.7.1"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.7.1.tgz#9a6723e35589dfdb13c2cd22259184946f0b275e"
......@@ -2685,15 +2685,24 @@
tslib "^1.9.3"
"@sentry/integrations@^6.2.0":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.7.2.tgz#1ddfb165b4aee42d0e9d9ef531c5ded8a73cbd61"
integrity sha512-IvOLqKVTxPxSJLbKVEe15BjvotnWBs86h5MJx3DLA/1HLP4xtUOvFsdmuMLJij5PtFG10HuUpRn8acEh5h9PTw==
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.10.0.tgz#f8f9e7efd55ec44d0408bd4493df1c9ceabaaa63"
integrity sha512-NMtB0jjFYFZRxyjYu2dWLThk9YPIwqhi4hYywmWkbv4/ILzi5Rwnh+aqNW6yrj8qG4b9itNMh3YvEzmf0aqauw==
dependencies:
"@sentry/types" "6.7.2"
"@sentry/utils" "6.7.2"
"@sentry/types" "6.10.0"
"@sentry/utils" "6.10.0"
localforage "^1.8.1"
tslib "^1.9.3"
"@sentry/minimal@6.10.0":
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.10.0.tgz#9404b93fae649b6c48e1da8f0991b87cf9999561"
integrity sha512-yarm046UgUFIBoxqnBan2+BEgaO9KZCrLzsIsmALiQvpfW92K1lHurSawl5W6SR7wCYBnNn7CPvPE/BHFdy4YA==
dependencies:
"@sentry/hub" "6.10.0"
"@sentry/types" "6.10.0"
tslib "^1.9.3"
"@sentry/minimal@6.7.1":
version "6.7.1"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.7.1.tgz#babf85ee2f167e9dcf150d750d7a0b250c98449c"
......@@ -2703,19 +2712,10 @@
"@sentry/types" "6.7.1"
tslib "^1.9.3"
"@sentry/minimal@6.7.2":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.7.2.tgz#9e6c0c587daea64a9042041694a4ad5d559d16cd"
integrity sha512-jkpwFv2GFHoVl5vnK+9/Q+Ea8eVdbJ3hn3/Dqq9MOLFnVK7ED6MhdHKLT79puGSFj+85OuhM5m2Q44mIhyS5mw==
dependencies:
"@sentry/hub" "6.7.2"
"@sentry/types" "6.7.2"
tslib "^1.9.3"
"@sentry/react-native@^2.2.1":
version "2.5.2"
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-2.5.2.tgz#d51188e926cffc597d816a906992b8da74fdb26e"
integrity sha512-AwcDZ+1SQ1EBFwnlYFGwSF/T3KrV1kdir3H9XOtR8WrxaItbwlkqwwP7D1EBMHu02WmuOgJ2a8aJlrhqEJ2pYA==
version "2.6.0"
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-2.6.0.tgz#1674ffa8c447581cde5e3566841841aa2bbbc25b"
integrity sha512-Sajrg7GWSZ1S26X2mIHRt+wCuc7CuPjdmx8tQfDg6cpswXgqryb0fv99VCpImb4ZB/WiaCTu2z9BSGUiZahnBg==
dependencies:
"@sentry/browser" "6.7.1"
"@sentry/core" "6.7.1"
......@@ -2750,15 +2750,23 @@
"@sentry/utils" "6.7.1"
tslib "^1.9.3"
"@sentry/types@6.10.0", "@sentry/types@^6.2.0":
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.10.0.tgz#6b1f44e5ed4dbc2710bead24d1b32fb08daf04e1"
integrity sha512-M7s0JFgG7/6/yNVYoPUbxzaXDhnzyIQYRRJJKRaTD77YO4MHvi4Ke8alBWqD5fer0cPIfcSkBqa9BLdqRqcMWw==
"@sentry/types@6.7.1":
version "6.7.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.7.1.tgz#c8263e1886df5e815570c4668eb40a1cfaa1c88b"
integrity sha512-9AO7HKoip2MBMNQJEd6+AKtjj2+q9Ze4ooWUdEvdOVSt5drg7BGpK221/p9JEOyJAZwEPEXdcMd3VAIMiOb4MA==
"@sentry/types@6.7.2", "@sentry/types@^6.2.0":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.7.2.tgz#8108272c98ad7784ddf9ddda0b7bdc6880ed6e50"
integrity sha512-h21Go/PfstUN+ZV6SbwRSZVg9GXRJWdLfHoO5PSVb3TVEMckuxk8tAE57/u+UZDwX8wu+Xyon2TgsKpiWKxqUg==
"@sentry/utils@6.10.0":
version "6.10.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.10.0.tgz#839a099fa0a1f0ca0893c7ce8c55ba0608c1d80f"
integrity sha512-F9OczOcZMFtazYVZ6LfRIe65/eOfQbiAedIKS0li4npuMz0jKYRbxrjd/U7oLiNQkPAp4/BujU4m1ZIwq6a+tg==
dependencies:
"@sentry/types" "6.10.0"
tslib "^1.9.3"
"@sentry/utils@6.7.1":
version "6.7.1"
......@@ -2768,18 +2776,10 @@
"@sentry/types" "6.7.1"
tslib "^1.9.3"
"@sentry/utils@6.7.2":
version "6.7.2"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.7.2.tgz#c7f957ebe16de3e701a0c5477ac2dba04e7b4b68"
integrity sha512-9COL7aaBbe61Hp5BlArtXZ1o/cxli1NGONLPrVT4fMyeQFmLonhUiy77NdsW19XnvhvaA+2IoV5dg3dnFiF/og==
dependencies:
"@sentry/types" "6.7.2"
tslib "^1.9.3"
"@sentry/wizard@^1.2.2":
version "1.2.9"
resolved "https://registry.yarnpkg.com/@sentry/wizard/-/wizard-1.2.9.tgz#ddccec63f766d87cb1863e7c5f33618d80277ec7"
integrity sha512-j6OdWF2W3Q24EmIXnNiomspJWKXicAPYnAUF1kcE4c+RuKxv/WFmPkSgg57BZRQ4613GUeHrs3eHGW6FDovolg==
version "1.2.10"
resolved "https://registry.yarnpkg.com/@sentry/wizard/-/wizard-1.2.10.tgz#93d751a33558bbfe4566683369fb3ac160408f02"
integrity sha512-KIMAvVoeCQU1RpQAJzvvCGWOeIEMB1TxQtMLBQED1YfJbhRTzKjnWgUSSrSVWb1nEnlm0iX/IOWJRH0nHMDHnQ==
dependencies:
"@sentry/cli" "^1.52.4"
chalk "^2.4.1"
......@@ -7046,6 +7046,11 @@ expo-status-bar@~1.0.4:
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.0.4.tgz#d8a4c4418b5868c1606969b12bdee85b6fa7d8a4"
integrity sha512-s7nc496D/Zn1NGiMJ5wu6HyIdXxbgGtmZZtbHm7rpbcmLdf28GmMSNHDx7M0t00BMhky7VAurTCUo+BJs8ugsw==
expo-structured-headers@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/expo-structured-headers/-/expo-structured-headers-1.0.1.tgz#2f3117fc9480e01aa6705493d3213060c2dcf683"
integrity sha512-U4frE8rT5x1LqZv5Ru/9CtzY8gh0wp1MfwTu5hetPydnwxXfWchuXvKgWRjEHglFU2X/29kYFY/J1UkPvCN8xg==
expo-updates@~0.3.5:
version "0.3.5"
resolved "https://registry.yarnpkg.com/expo-updates/-/expo-updates-0.3.5.tgz#cd9aafeb5cbe16399df7d39243d00d330d99e674"
......@@ -7055,6 +7060,18 @@ expo-updates@~0.3.5:
fbemitter "^2.1.1"
uuid "^3.4.0"
expo-updates@~0.5.4:
version "0.5.5"
resolved "https://registry.yarnpkg.com/expo-updates/-/expo-updates-0.5.5.tgz#97118ce3fcc8cc77ce74ec8b7c91ac4c29dc770c"
integrity sha512-1R8EKkT3GoDjMRQnDaTYv31gIYIaYQGHOrjHJfwq8ai9f1W1AHux6KAH2/H6sc2o9a7roWVwjDn2kKwCm9AeHg==
dependencies:
"@expo/config-plugins" "^1.0.18"
"@expo/metro-config" "^0.1.59"
expo-structured-headers "~1.0.1"
fbemitter "^2.1.1"
resolve-from "^5.0.0"
uuid "^3.4.0"
expo-web-browser@~9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/expo-web-browser/-/expo-web-browser-9.1.0.tgz#4951213f3b57a206dfc5f3f7b2fd1b73863a33af"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment