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

EcrituresNumeriques / stylo / 15281344514

27 May 2025 05:04PM UTC coverage: 37.39% (-0.2%) from 37.543%
15281344514

push

github

web-flow
chore: vérifie que l'article existe (#1521)

549 of 776 branches covered (70.75%)

Branch coverage included in aggregate %.

1 of 129 new or added lines in 5 files covered. (0.78%)

6 existing lines in 3 files now uncovered.

5319 of 14918 relevant lines covered (35.65%)

2.55 hits per line

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

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

UNCOV
5
import { captureException } from '@sentry/react'
×
6

7
import styles from '../components/Error.module.scss'
×
8

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

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

NEW
17
  if (error.status === 404) {
×
NEW
18
    return (
×
NEW
19
      <section className={styles.container}>
×
NEW
20
        <article className={styles.error}>
×
NEW
21
          <h2>{t('404.title')}</h2>
×
NEW
22
          <p>
×
NEW
23
            {t('404.message')} <code>{error.message}</code>.
×
NEW
24
          </p>
×
NEW
25
        </article>
×
NEW
26
      </section>
×
27
    )
NEW
28
  }
×
29

30
  if (isRouteErrorResponse(error) || Object.hasOwn(error, 'message')) {
×
31
    return (
×
32
      <section className={styles.container}>
×
33
        <article className={styles.error}>
×
34
          <h2>{t('title')}</h2>
×
35

36
          <p>
×
37
            {t('message')}
×
38
            <q>
×
39
              {error.statusText
×
40
                ? `${error.status} ${error.statusText}`
×
41
                : error.message}
×
42
            </q>
×
43
          </p>
×
44

45
          {error.stack ||
×
46
            (error.data && (
×
47
              <details>
×
48
                <pre>
×
49
                  <code>{error.stack ?? error.data}</code>
×
50
                </pre>
×
51
              </details>
×
52
            ))}
53
        </article>
×
54
      </section>
×
55
    )
56
  } else {
×
57
    return <h1>{t('unknown')}</h1>
×
58
  }
×
59
}
×
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

© 2026 Coveralls, Inc