Skip to content

Errors

When something goes wrong, String tells the AI what happened and what it can do about it. Errors are plain text — readable, actionable, and consistent across all commands.


Every error follows the same structure:

✗ ERROR_CODE: message
context
  • — error indicator (vs for success)
  • Error code — machine-readable identifier
  • Message — human-readable description
  • Context — actionable details (available options, suggestions)

NOT_FOUND — the topic does not exist.

/open ~/docs/missing.md
✗ NOT_FOUND: file not found
path: ~/docs/missing.md
/open @nonexistent
✗ NOT_FOUND: shortcut not found
@nonexistent is not defined in this document
available: @docs, @pricing, @main.home, @main.api

BLOCK_NOT_FOUND — the file exists but the block doesn’t.

/open ~/docs/report.md#missing
✗ BLOCK_NOT_FOUND: block #missing not found in ~/docs/report.md
available blocks: #summary, #details, #appendix

INVALID_PATH — the path is malformed or outside workspace.

/write /etc/passwd
✗ INVALID_PATH: path is outside workspace boundary
workspace: ~/
requested: /etc/passwd
/write ../../../etc/shadow
✗ INVALID_PATH: path traversal not allowed
resolved: /etc/shadow (outside workspace)

LINE_OUT_OF_RANGE — line number doesn’t exist.

/replace ~/docs/report.md:L500
new content
✗ LINE_OUT_OF_RANGE: line 500 does not exist
~/docs/report.md has 42 lines

CONFLICT — the file was modified externally since last read.

/replace ~/docs/report.md#summary
new summary
✗ CONFLICT: file has been modified since last read
expected: hash abc123
current: hash def456
use /refresh to reload, then retry

ACTION_NOT_FOUND — the action is not defined in the current document.

/act.nonexistent --flag value
✗ ACTION_NOT_FOUND: action nonexistent is not defined
available actions: search_city, create_alert

INVALID_PARAMS — required parameters missing or invalid.

/act.search_city
✗ INVALID_PARAMS: missing required parameter
name: string (required) — not provided
usage: /act.search_city --name "{City Name}"
/act.create_alert --condition "earthquake"
✗ INVALID_PARAMS: invalid value for condition
expected: rain|snow|temp
received: earthquake

ACTION_FAILED — the action executed but the backend returned an error.

/act.search_city --name "Atlantis"
✗ ACTION_FAILED: upstream error (404)
GET https://api.weather.com/search?name=Atlantis
response: city not found

INVALID_VARIABLE$ variable used in AI command.

/act.search --key $API_KEY
✗ INVALID_VARIABLE: runtime variable $API_KEY cannot be used in commands
$variables are only allowed in document action definitions

UNDEFINED_VARIABLE — referenced variable has no value.

/act.get_repos --token {token}
✗ UNDEFINED_VARIABLE: {token} is not defined in current session
use /set or an action response template to define it

COMMAND_UNSUPPORTED — input does not start with /.

<𝒞=string:file:main>
hello world
</𝒞>
✗ COMMAND_UNSUPPORTED: Commands must start with /. Use /help for details.

All input must be a command. Plain text is not accepted.


INVALID_TARGET — the topic identifier is malformed.

<𝒞=string:intro.md>
/open index.md
</𝒞>
✗ INVALID_TARGET: invalid topic "intro.md"
format: type:name (e.g. file:main, web:docs, app:weather)
names: [a-zA-Z0-9_-]+ only — no dots, no paths

NO_HISTORY/back with nothing to go back to.

/back
✗ NO_HISTORY: no previous location in this topic

NO_COMMITS/log on a file with no commits.

/log ~/docs/new-file.md
✗ NO_COMMITS: ~/docs/new-file.md has no commit history
use /commit to create the first snapshot

VERSION_NOT_FOUND — requested version doesn’t exist.

/open ~/docs/report.md@c99
✗ VERSION_NOT_FOUND: version c99 not found
latest: c3
use /log ~/docs/report.md to see available versions

CodeWhen
NOT_FOUNDFile, URL, or shortcut doesn’t exist
BLOCK_NOT_FOUNDBlock ID not in document
INVALID_PATHPath outside workspace or malformed
LINE_OUT_OF_RANGELine number exceeds file length
CONFLICTFile modified externally since last read
COMMAND_UNSUPPORTEDInput doesn’t start with / (plain text rejected)
ACTION_NOT_FOUNDAction not defined in document
INVALID_PARAMSMissing or invalid action parameters
ACTION_FAILEDBackend returned an error
INVALID_VARIABLE$var used in AI command
UNDEFINED_VARIABLE{var} has no value in session
INVALID_TARGETTopic identifier malformed (dots, paths, unknown type)
NO_HISTORYNo previous location for /back
NO_COMMITSNo version history for file
VERSION_NOT_FOUNDRequested version doesn’t exist
LOAD_ERRORNetwork or I/O failure loading content
AUTH_REQUIREDTopic requires authentication

Most errors include enough context to fix the issue:

✗ BLOCK_NOT_FOUND: block #sumary not found
available blocks: #summary, #details
→ AI sees the typo, retries with #summary

When an action fails, try an alternative path:

✗ ACTION_FAILED: upstream error (503)
→ /back and try a different approach
→ or /refresh and retry later

When the error is about permissions or missing configuration:

✗ AUTH_REQUIRED: https://api.example.com requires authentication
→ AI reports to user that authentication is needed

Errors are text. Not JSON error objects, not HTTP status codes wrapped in XML. Plain text that any AI can read without a parser.

Errors are actionable. Every error includes context that helps the AI fix the problem — available blocks, correct syntax, valid options. The AI shouldn’t need an extra round trip to figure out what went wrong.

Errors are consistent. Same format across all commands. The AI learns one error pattern and it works everywhere.


PrincipleHow
Format✗ CODE: message + context
ContextAvailable options, correct syntax, suggestions
ActionableAI can fix and retry without extra round trip
ConsistentSame structure for all commands
Plain textNo special parsing needed