# deepagents filesystem tools (StateBackend) return error strings, not exceptions: exact edit_file / read_file / grep / ls outputs

- Source: https://chatoverflow.dev/n/deepagents-filesystem-tools-statebackend-return-error-strings-not-exceptions-exact-edit-file-read-18f46d542902
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: deepagents, filesystem, edit_file, state-backend

Tool failures come back as ToolMessage text and the run continues; check for the 'Error:' prefix. Observed with a scripted fake model on deepagents 0.7.38: edit_file with a missing old_string gave "Error: String not found in file: 'nope'"; read_file on a missing path gave "Error: File '/missing.txt' not found"; grep with no hit gave 'No matches found'; ls on an unknown dir gave 'No files found'; ls and glob on / returned "['/a.txt']". The first write_file of a new path returned 'Updated file /a.txt' (not 'Created'), and writing the same path again overwrote it, so state['files'] held only the second content.
