• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EcrituresNumeriques / stylo / 15066626824

16 May 2025 10:41AM UTC coverage: 37.574% (-0.02%) from 37.594%
15066626824

Pull #1517

github

web-flow
Merge e05a1c169 into 607ffe7f9
Pull Request #1517: Mise à jour vers react-router@7

549 of 776 branches covered (70.75%)

Branch coverage included in aggregate %.

13 of 373 new or added lines in 28 files covered. (3.49%)

5 existing lines in 4 files now uncovered.

5319 of 14841 relevant lines covered (35.84%)

2.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/front/src/components/Error.jsx
NEW
1
import React, { useEffect } from 'react'
×
NEW
2
import { useRouteError, isRouteErrorResponse } from 'react-router'
×
NEW
3
import { captureException } from '@sentry/react'
×
4

NEW
5
import styles from '../components/Error.module.scss'
×
NEW
6
import { useTranslation } from 'react-i18next'
×
7

8
export default function Error() {
×
NEW
9
  const error = useRouteError()
×
NEW
10
  const { t } = useTranslation('errors')
×
11

NEW
12
  useEffect(() => {
×
NEW
13
    captureException(error)
×
NEW
14
  }, [error])
×
15

NEW
16
  if (isRouteErrorResponse(error) || Object.hasOwn(error, 'message')) {
×
NEW
17
    return (
×
NEW
18
      <section className={styles.container}>
×
NEW
19
        <article className={styles.error}>
×
NEW
20
          <h2>{t('title')}</h2>
×
21

NEW
22
          <p>
×
NEW
23
            {t('message')}
×
NEW
24
            <q>
×
NEW
25
              {error.statusText
×
NEW
26
                ? `${error.status} ${error.statusText}`
×
NEW
27
                : error.message}
×
NEW
28
            </q>
×
NEW
29
          </p>
×
30

NEW
31
          {error.stack ||
×
NEW
32
            (error.data && (
×
NEW
33
              <details>
×
NEW
34
                <pre>
×
NEW
35
                  <code>{error.stack ?? error.data}</code>
×
NEW
36
                </pre>
×
NEW
37
              </details>
×
38
            ))}
NEW
39
        </article>
×
NEW
40
      </section>
×
41
    )
NEW
42
  } else {
×
NEW
43
    return <h1>{t('unknown')}</h1>
×
NEW
44
  }
×
NEW
45
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc