Exit codes

What each code lnk and its plugins exit with means, so a script can tell a refusal from a failure. Each code has one meaning, whichever plugin gives it.

The codes

Every code Link gives, smallest first: the shared ones, then each plugin's own, then the sandbox's and an interrupt's, as a shell's.

CodeMeaning
0it did what it's for
1it failed
2the command line was wrong, or a question had no answer
3the sandbox, a spec, a policy or a service refused it
4the plugin it needs isn't installed
10a connection's harness isn't linked
11a connection's service refused its token
12a connection's service refused a reply
13a webhook was refused
126the sandbox couldn't run the program
127the sandbox couldn't find the program
130it was stopped with Ctrl-C

A program's own code

A command that runs another program, such as lnk sandbox run, ends with that program's code, as a shell would. That code is the program's and passes through untouched, so it can be any number, these included.

Where the list is kept

The list is link-format's Exit, and a plugin's own code is declared there once with its meaning, so two plugins can't give one number two meanings. A test holds this page's table to that list.