Nucleus handler tools › Docs › Checks

A return inside finally

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

Why it matters

A return/throw in finally overrides the one in try/catch, hiding errors.

Example

✗ Wrong

function f() {
  try {
    return 1;
  } finally {
    return 2;
  }
}
f();

✓ Right

function f() {
  try {
    return 1;
  } finally {
    Context.StartArguments = "";
  }
}

How to fix it

Don't return or throw in finally.

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-unsafe-finally": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule no-unsafe-finally=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