---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B014 [*] Exception handler with duplicate exception: `OSError`
  --> B014.py:17:8
   |
15 | try:
16 |     pass
17 | except (OSError, OSError) as err:
   |        ^^^^^^^^^^^^^^^^^^
18 |     # Duplicate exception types are useless
19 |     pass
   |
help: De-duplicate exceptions
   |
16 |     pass
   - except (OSError, OSError) as err:
17 + except OSError as err:
18 |     # Duplicate exception types are useless
   |

B014 [*] Exception handler with duplicate exception: `MyError`
  --> B014.py:28:8
   |
26 | try:
27 |     pass
28 | except (MyError, MyError):
   |        ^^^^^^^^^^^^^^^^^^
29 |     # Detect duplicate non-builtin errors
30 |     pass
   |
help: De-duplicate exceptions
   |
27 |     pass
   - except (MyError, MyError):
28 + except MyError:
29 |     # Detect duplicate non-builtin errors
   |

B014 [*] Exception handler with duplicate exception: `re.error`
  --> B014.py:49:8
   |
47 | try:
48 |     pass
49 | except (re.error, re.error):
   |        ^^^^^^^^^^^^^^^^^^^^
50 |     # Duplicate exception types as attributes
51 |     pass
   |
help: De-duplicate exceptions
   |
48 |     pass
   - except (re.error, re.error):
49 + except re.error:
50 |     # Duplicate exception types as attributes
   |

B014 [*] Exception handler with duplicate exception: `ValueError`
  --> B014.py:82:8
   |
80 | try:
81 |     pass
82 | except (ValueError, ValueError, TypeError):
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |     pass
   |
help: De-duplicate exceptions
   |
81 |     pass
   - except (ValueError, ValueError, TypeError):
82 + except (ValueError, TypeError):
83 |     pass
   |

B014 [*] Exception handler with duplicate exception: `re.error`
  --> B014.py:89:7
   |
87 | try:
88 |     pas
89 | except(re.error, re.error):
   |       ^^^^^^^^^^^^^^^^^^^^
90 |     p
   |
help: De-duplicate exceptions
   |
88 |     pas
   - except(re.error, re.error):
89 + except re.error:
90 |     p
   |

B014 [*] Exception handler with duplicate exception: `ValueError`
   --> B014.py:95:8
    |
 93 |   try:
 94 |       pass
 95 |   except (
    |  ________^
 96 | |     ValueError,
 97 | |     ValueError,
 98 | |     # text
 99 | |     TypeError,
100 | | ):
    | |_^
101 |       pass
    |
help: De-duplicate exceptions
   |
94 |     pass
   - except (
   -     ValueError,
   -     ValueError,
   -     # text
   -     TypeError,
   - ):
95 + except (ValueError, TypeError):
96 |     pass
   |
note: This is an unsafe fix and may change runtime behavior
