---
source: crates/oxc_linter/src/tester.rs
expression: no_useless_catch
---
  ⚠ eslint(no-useless-catch): Unnecessary try/catch wrapper
   ╭─[no_useless_catch.tsx:3:1]
 3 │           foo();
 4 │         } catch (err) {
   ·                  ─┬─
   ·                   ╰── is caught here
 5 │           throw err;
   ·           ─────┬────
   ·                ╰── and re-thrown here
 6 │         }
   ╰────

  ⚠ eslint(no-useless-catch): Unnecessary catch clause
   ╭─[no_useless_catch.tsx:3:1]
 3 │           foo();
 4 │         } catch (err) {
   ·                  ─┬─
   ·                   ╰── is caught here
 5 │           throw err;
   ·           ─────┬────
   ·                ╰── and re-thrown here
 6 │         } finally {
   ╰────

  ⚠ eslint(no-useless-catch): Unnecessary try/catch wrapper
   ╭─[no_useless_catch.tsx:3:1]
 3 │           foo();
 4 │         } catch (err) {
   ·                  ─┬─
   ·                   ╰── is caught here
 5 │           /* some comment */
 6 │           throw err;
   ·           ─────┬────
   ·                ╰── and re-thrown here
 7 │         }
   ╰────

  ⚠ eslint(no-useless-catch): Unnecessary catch clause
   ╭─[no_useless_catch.tsx:3:1]
 3 │           foo();
 4 │         } catch (err) {
   ·                  ─┬─
   ·                   ╰── is caught here
 5 │           /* some comment */
 6 │           throw err;
   ·           ─────┬────
   ·                ╰── and re-thrown here
 7 │         } finally {
   ╰────

  ⚠ eslint(no-useless-catch): Unnecessary try/catch wrapper
   ╭─[no_useless_catch.tsx:4:1]
 4 │             await doSomething();
 5 │           } catch (e) {
   ·                    ┬
   ·                    ╰── is caught here
 6 │             throw e;
   ·             ────┬───
   ·                 ╰── and re-thrown here
 7 │           }
   ╰────


