Nucleus handler tools › Docs › Checks

A caught error overwritten

Warningno-ex-assignA general JavaScript mistake (ESLint's no-ex-assign) · Probably wrong: Nucleus runs it, but not the way you meant.

Why it matters

Overwriting the caught error loses it.

Example

✗ Wrong

try {
  Game.MaxPlayers = 4;
} catch (e) {
  e = null;
}

✓ Right

try {
  Game.MaxPlayers = 4;
} catch (e) {
  var err = e;
}

How to fix it

Copy the error to a new variable instead.

Turn it off, or change how it shows

Each check can be shown as an error, warning, info or hint, or turned off. VS Code: "splitscreenme.lint.rules": { "no-ex-assign": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule no-ex-assign=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right? Tell us what's wrong
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop