+ {{ $t('projects.settings.integrations.sentryDSNTextNoToken') }} +
++ {{ $t('projects.settings.integrations.sentryDSNTextNoToken') }} +
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 7f9bf152..de862a6e 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -138,7 +138,8 @@ "description": "After this action, Hawk will stop accepting events with the old integration token. You will need to replace it with a new one in your project." }, "sentryDSN": "Sentry DSN", - "sentryDSNText": "If you use Sentry SDK, you can use this DSN to send errors to Hawk." + "sentryDSNText": "If you use Sentry SDK, you can use this DSN to send errors to Hawk.", + "sentryDSNTextNoToken": "It seems, you have an old integration token. Try to revoke it and get the new one." }, "notifications": { "title": "Notifications", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index bff11662..24d8ccde 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -138,7 +138,8 @@ "description": "После этого действия Хоук перестанет принимать ивенты со старым интеграционным токеном. Вам будет необходимо заменить его на новый в вашем проекте." }, "sentryDSN": "Sentry DSN", - "sentryDSNText": "Если вы используете Sentry SDK, вы можете использовать этот DSN для того, чтобы отправлять ошибки в Хоук." + "sentryDSNText": "Если вы используете Sentry SDK, вы можете использовать этот DSN для того, чтобы отправлять ошибки в Хоук.", + "sentryDSNTextNoToken": "Кажется, у вас старый интеграционный токен. Попробуйте отозвать его и получить новый." }, "notifications": { "title": "Уведомления", diff --git a/src/utils.ts b/src/utils.ts index fcc0cc5c..d10b00ae 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -509,5 +509,9 @@ function getHexIntegrationToken(token: string): string { * @param token - stringified integration token */ export function getSentryDSN(token: string): string { - return `https://${getHexIntegrationToken(token)}@k1.hawk.so/0`; + try { + return `https://${getHexIntegrationToken(token)}@k1.hawk.so/0`; + } catch (e) { + return ''; + } }