error-handling
Skill18k starsChanged 7 months agoMITView on GitHub
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
44 other projects use a version of this.
Trending
Steady talk.about the whole repository
Most recently taken up by
- SkillMedev/ai-engineer-toolkittheir own version, first seen Oct 5, 2026
- LuisUrrutia/skillstheir own version, first seen Oct 4, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- komluk/scaffoldingtheir own version, first seen Sep 28, 2026
- alfredobs97/flutter_agentic_templatetheir own version, first seen Sep 24, 2026
Who's talking about microsoft/data-formulator
- A Hacker News story“Show HN: Data Formulator – AI-powered data visualization from Microsoft Research”Hacker News · Oct 21, 2024 · 212 points
- @sungkim.bsky.social“Microsoft Data Formulator Data Formulator is an AI-powered tool for analysts to iteratively create rich …”Bluesky · Feb 11, 2025 · 39 likes
- @msftresearch.bsky.social“Data Formulator from @msftresearch.bsky.social is currently the top trending repo on @github.com! Have you …”Bluesky · Feb 12, 2025 · 13 likes
- @josefslerka.bsky.social“github.com/microsoft/da... ❤️”Bluesky · Mar 21, 2025 · 6 likes
- @github-trending-js.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / data-formulator ⭐ 15,511 (+112) 🗒 TypeScript 🪄 Create …”Bluesky · May 13, 2026 · 3 likes
The biggest 5 of 31 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 31
Talked about on Bluesky, GitHub and Hacker News (31 times).
On Bluesky · 22
- Feb 11, 2025Microsoft Data Formulator Data Formulator is an AI-powered tool for analysts to iteratively create rich visualizations. Data Formulator… — @sungkim.bsky.social39 likes and reposts
- Feb 12, 2025Data Formulator from @msftresearch.bsky.social is currently the top trending repo on @github.com! Have you tried the no-code, AI-driven,… — @msftresearch.bsky.social13 likes and reposts
- Mar 21, 2025github.com/microsoft/da... ❤️ — @josefslerka.bsky.social6 likes and reposts
- May 13, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / data-formulator ⭐ 15,511 (+112) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social3 likes and reposts
- Feb 17, 2025Data Formulator from @microsoft.com enables users to create complex data visualizations without needing expertise in data transformation or… — @gradientflow.com3 likes and reposts
17 more on Bluesky
- Apr 21, 2025📦 microsoft / data-formulator ⭐ 11,387 (+52) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social2 likes and reposts
- Mar 22, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / data-formulator ⭐ 10,632 (+490) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social2 likes and reposts
- Mar 20, 2025🪄 Create rich visualizations with AI — @midnattssol.bsky.social2 likes and reposts
- Mar 19, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / data-formulator ⭐ 9,335 (+310) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending.bsky.social2 likes and reposts
- Mar 18, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / data-formulator ⭐ 9,111 (+252) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social2 likes and reposts
- Feb 12, 2025Here is an interesting open source LLM data visualization library from @microsoft.com that's trending! github.com/microsoft/da... — @cloudlogicallyinc.bsky.social2 likes and reposts
- Feb 11, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / data-formulator ⭐ 2,810 (+328) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending.bsky.social2 likes and reposts
- Feb 9, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / data-formulator ⭐ 1,824 (+146) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social2 likes and reposts
- Feb 23, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / data-formulator ⭐ 15,022 (+112) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social1 likes and repost
- Nov 18, 2025GitHub - microsoft/data-formulator: 🪄 Create rich visualizations with AI github.com/microsoft/da... — @cjlise.eurosky.social1 likes and repost
- Oct 19, 2025https://github.com/microsoft/data-formulator/ — @tom-doerr.bsky.social1 likes and repost
- Aug 18, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / data-formulator ⭐ 13,138 (+113) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social1 likes and repost
- Apr 20, 2025https://github.com/microsoft/data-formulator — @tom-doerr.bsky.social1 likes and repost
- Mar 12, 2025📦 microsoft / data-formulator ⭐ 8,689 (+76) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social1 likes and repost
- Oct 23, 2024GitHub - microsoft/data-formulator: 🪄 Create rich visualizations with AI https://github.com/microsoft/data-formulator — @tech-trending.bsky.social1 likes and repost
- Jun 3, 2025repo: github.com/microsoft/d... — @graplify.bsky.social0 likes and reposts · 1 reply
- Feb 13, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / data-formulator ⭐ 5,525 (+794) 🗒 TypeScript 🪄 Create rich visualizations with AI — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On GitHub · 7
- Jul 27, 2026Repomix now fails on repos using backslash in .gitignore patterns — yamadashy/repomix1 reaction · 10 comments
- Oct 13, 2026Evidence: record the question each result answers and its named inputs — quentin-hickam/analytics-workbench0 reactions
- Oct 8, 2026[Candidate] microsoft/data-formulator/.cursor/skills/error-handling - error-handling — ProSkillsMD/proskills0 reactions · 1 comment
- Aug 3, 2026fix(file): handle escaped gitignore device-name rules — yamadashy/repomix0 reactions · 2 comments
- May 9, 2026【学术讨论】AI 数据可视化分析系统 - 技术升级方向调研 — nanyihao199983/ai-path-analysis0 reactions · 1 comment
2 more on GitHub
- Feb 11, 2025Support code-interpreter with data visualization — refly-ai/refly0 reactions
- Feb 7, 2025Chore: Resolves #11800: Web: Improve reload behavior in dev mode — laurent22/joplin0 reactions · 2 comments
On Hacker News · 2
- Oct 21, 2024Show HN: Data Formulator – AI-powered data visualization from Microsoft Research212 points · 34 comments
- Oct 2, 2024Data Formulator: AI-powered visualization tool from microsoft research1 point
Used with
Projects with it also use logging, state-management and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
diego-tobalinaSkilllogging
Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.
Also in 5 projects that use this
conorluddySkillstate-management
Cache management, configuration best practices, and progressive disclosure patterns for efficient context window usage. Use when working with large responses, optimizing token costs, or managing plugin state across operations.
Also in 5 projects that use this
DatabricksSkillload-testing
Load test a Databricks App to find its maximum QPS. Use when: (1) User says 'load test', 'benchmark', 'QPS', 'throughput', or 'performance test', (2) User wants to find how many queries per second their app can handle, (3) User wants to set up load testing scripts for their agent, (4) User wants to view load test results/dashboard, (5) User wants to validate results or observe latency/error rate with MLflow tracing.
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 5 projects that use this
ffsshhttiikkSkilli18n
Internationalization and localization
Also in 5 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 6 projects that use this
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- codewithmukesh/dotnet-claude-kit★ 750same name
- templetongroup/radiant★ 113same name
- DevelopersGlobal/ai-agent-skills★ 69same name
- metarhia/metaskills★ 57same name
- suhailkakar/the-skills★ 26same name
- komluk/scaffolding★ 15same name
- zircote-plugins/claude-team-orchestration★ 15same name
- wpank/ai★ 11same name
- jiatastic/open-python-skills★ 9same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/backend-test-conventions.mdcCursor rule
- .cursor/rules/dataframe-serialization.mdcCursor rule
- .cursor/rules/dev-guides-first.mdcCursor rule
- .cursor/rules/error-response-safety.mdcCursor rule
- .cursor/rules/frontend-test-conventions.mdcCursor rule
- .cursor/rules/i18n-no-hardcoded-strings.mdcCursor rule
- .cursor/rules/implementation-review-checklist.mdcCursor rule
- .cursor/rules/incremental-development-cadence.mdcCursor rule
- .cursor/rules/language-injection-conventions.mdcCursor rule
- .cursor/rules/log-sanitization.mdcCursor rule
- .cursor/rules/package-manager-conventions.mdcCursor rule
- .cursor/rules/path-safety.mdcCursor rule
- .cursor/rules/test-driven-workflow.mdcCursor rule
- .cursor/rules/unified-error-protocol.mdcCursor rule
- language-injectionSkill
- path-safetySkill
- coreSkill
- data-loadingSkill
- data-loadingSkill
- reportSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 6 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 37 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Use this contract for all new or reworked DF APIs:
- Very specific: line 46
Do not use HTTP 400/422 for application validation errors in new code.
- Very specific: line 47
Do not convert in-flight NDJSON errors to status: "error".
- Distinctive: line 191
Do not apply the normal JSON API protocol mechanically to file downloads / CSV streaming, SPA fallback, OIDC redirect flows, frontend …
- Very specific: line 202
No HTTP mapping needed — defaults to HTTP 200.
- Distinctive: line 215
All streaming endpoints are now on the unified protocol:
- Very specific: line 235
Not all .catch(() => {}) are bugs.
- Distinctive: line 244
When consuming a migrated streaming endpoint, handle the current NDJSON event format directly:
- Very specific: line 296
All JSON errors include error.request_id and an X-Request-Id response header.
- Distinctive: line 304
When an error isn't reaching the frontend:
- Distinctive: line 361
When adding a module that handles credentials or external services:
- Very specific: line 364
Use sanitize_params() for dicts, sanitize_url() for URLs, redact_token() for tokens
- Very specific: line 365
Prefer type(exc).__name__ over str(exc) in warning-level logs
- Very specific: line 366
If introducing new credential key names, add to SENSITIVE_KEYS in log_sanitizer.py
“Common” is measured: kept by at least 6 in 10 of the 37 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Error Handling Skill
Unified error handling system for DF. Use when adding API endpoints, modifying error handling, or adding frontend API calls.
Prerequisites: Read
docs/dev-guides/7-unified-error-handling.mdbefore changing API error behavior. Readdocs/dev-guides/2-log-sanitization.mdwhen the work involves logging, credentials, external services, or DataLoaders. If your work introduces new error handling patterns or conventions, update this file and related dev-guides accordingly.
Architecture Overview
Frontend Backend
──────── ───────
apiClient.ts errors.py
├── apiRequest() ←── JSON ──── ├── ErrorCode (enum)
├── streamRequest() ←── NDJSON ── └── AppError (exception)
└── parseStreamLine()
error_handler.py
errorCodes.ts ├── register_error_handlers(app)
└── getErrorMessage() ├── classify_and_wrap_llm_error()
└── stream_error_event()
errorHandler.ts
└── handleApiError() security/sanitize.py
└── classify_llm_error() (internal)
MessageSnackbar ← dfSlice.messagesProtocol Snapshot
Use this contract for all new or reworked DF APIs:
| Scenario | HTTP | Shape |
| Non-streaming success | 200 | {"status": "success", "data": ...} |
| Non-streaming business/validation error | 200 | {"status": "error", "error": {"code", "message", "retry", "request_id"}} |
| Non-streaming auth/authorization error | 401 / 403 | same structured error body |
| Streaming preflight error | 200 | application/json + {"status": "error", "error": ...} |
| Streaming in-flight fatal error | 200 | NDJSON line: {"type": "error", "error": ...} |
| No Flask route / too large / unhandled crash | 404 / 413 / 500 | transport-level error |
Do not use HTTP 400/422 for application validation errors in new code.
Do not convert in-flight NDJSON errors to status: "error"; once the stream has
started, event type is the protocol discriminator.
Backend: Adding a New API Endpoint
HTTP Status Code Policy
Application-controlled business and validation errors return HTTP 200 with
status: "error" in the body. Only these use non-200:
401/403— auth errors (AUTH_REQUIRED,AUTH_EXPIRED,ACCESS_DENIED)404— no matching Flask route413— WSGI body limit exceeded500— unhandled exception (program bug)
Non-streaming endpoint
from data_formulator.errors import AppError, ErrorCode
from data_formulator.error_handler import json_ok
@bp.route('/my-endpoint', methods=['POST'])
def my_endpoint():
content = request.get_json()
if not content.get('required_field'):
raise AppError(ErrorCode.INVALID_REQUEST, "Missing required_field")
try:
result = do_work(content)
except SomeBusinessError as e:
raise AppError(ErrorCode.DATA_LOAD_ERROR, "Failed to load data") from e
except Exception as e:
from data_formulator.error_handler import classify_and_wrap_llm_error
raise classify_and_wrap_llm_error(e) from e
return json_ok(result)
# Global handler returns: HTTP 200 + {"status": "error", "error": {code, message, retry}}
# Auth errors (AUTH_REQUIRED/AUTH_EXPIRED/ACCESS_DENIED) return 401/403Legacy {"status": "error", "message": "..."}, error_message, bare {error},
and status: "ok" responses are historical formats. Do not add new compatibility
branches for them; migrate the route to json_ok() / AppError before using
apiRequest().
Streaming endpoint
Validation MUST be outside the generator. Failures return 200 JSON (not NDJSON).
from data_formulator.errors import AppError, ErrorCode
from data_formulator.error_handler import (
classify_and_wrap_llm_error,
stream_error_event,
stream_preflight_error,
)
@bp.route('/my-stream', methods=['POST'])
def my_stream():
if not request.is_json:
return stream_preflight_error(
AppError(ErrorCode.INVALID_REQUEST, "Invalid request")
)
content = request.get_json()
client = get_client(content['model'])
def generate():
try:
for event in agent.run(...):
yield json.dumps(event, ensure_ascii=False) + "\n"
except Exception as e:
yield stream_error_event(classify_and_wrap_llm_error(e))
return Response(stream_with_context(generate()), mimetype='application/x-ndjson')Streaming runtime errors intentionally use {"type": "error", "error": ...}.
They cannot use a top-level status envelope because the HTTP response and NDJSON
event stream have already started.
Frontend: Consuming an API
Non-streaming
import { apiRequest } from '../app/apiClient';
import { handleApiError } from '../app/errorHandler';
try {
const { data } = await apiRequest<ResponseType>(getUrls().MY_ENDPOINT, {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' },
});
} catch (e) {
handleApiError(e, 'MyComponent');
}For UI loading state, model the request lifecycle explicitly with
LoadableState from src/app/loadableState.ts. Do not infer loading from
missing data (!data), because failed requests may legitimately leave data
empty while loading has ended.
Streaming
import { streamRequest } from '../app/apiClient';
import { handleApiError } from '../app/errorHandler';
try {
for await (const event of streamRequest(url, options, abortController.signal)) {
switch (event.type) {
case 'text_delta':
break;
case 'error':
// Error arrived mid-stream — show inline in component.
break;
case 'done':
break;
}
}
} catch (e) {
handleApiError(e, 'MyComponent');
}With callbacks
handleApiError(e, 'MyComponent', {
onAuth: () => redirectToLogin(), // AUTH_REQUIRED / AUTH_EXPIRED
onRetryable: () => retryOperation(), // LLM_RATE_LIMIT / LLM_TIMEOUT
silent: true, // don't show Snackbar (component handles display)
});Migration and special cases
DF API consumers should use apiRequest() / streamRequest() and
handleApiError(). Direct fetchWithIdentity() is for lower-level client helpers
and explicit protocol exceptions such as file downloads, blob/CSV responses,
OIDC redirects, SPA fallback, or third-party URLs.
Do not apply the normal JSON API protocol mechanically to file downloads / CSV
streaming, SPA fallback, OIDC redirect flows, frontend fetches to third-party
URLs, or errors after a streaming response has already started. Check the route's
protocol first, then preserve safe error bodies and avoid str(exc) exposure.
Adding a New Error Code
- Backend — Add to
py-src/data_formulator/errors.pyErrorCode:
No HTTP mapping needed — defaults to HTTP 200. Only add toMY_NEW_ERROR = "MY_NEW_ERROR"ERROR_CODE_HTTP_STATUSif it's an auth code. - Frontend mapping — Add to
src/app/errorCodes.tsERROR_CODE_I18N_MAP:MY_NEW_ERROR: 'errors.myNewError', - Translations — Add to both locale files:
src/i18n/locales/en/errors.json:"myNewError": "English message"src/i18n/locales/zh/errors.json:"myNewError": "中文消息"
Migrated Endpoints Reference
All streaming endpoints are now on the unified protocol:
| Endpoint | Format | Notes |
/data-agent-streaming | NDJSON + stream_error_event() | Emits top-level type events; errors use {type:"error", error:{...}} |
/get-recommendation-questions | NDJSON + stream_error_event() | Was error: {json} prefix |
/generate-report-chat | Pure NDJSON + stream_error_event() | Was SSE data: {json} prefix |
/data-loading-chat | NDJSON + stream_error_event() | str(e) removed |
/clean-data-stream | NDJSON + stream_error_event() | Was \n{json}\n format |
Non-streaming endpoints:
| Endpoint | Error Format | Notes |
/chart-insight | AppError → HTTP 200 + {status:"error", error:{code,message,retry}} | Fully migrated. Frontend uses fetchChartInsight rejected reducer. |
| All migrated endpoints | AppError → HTTP 200 + unified error body | credentials, knowledge, sessions, tables, agents |
/derive-data, /refine-data, /sort-data, /process-data-on-load, /test-model | json_ok() / AppError | Migrated to new format |
Empty Catch Policy
Not all .catch(() => {}) are bugs. Use this decision tree:
- User-initiated action (delete, refresh, submit) → must notify with
addMessagesorhandleApiError() - Background/best-effort fetch (connector list on mount, session list) → OK to swallow, but add a comment
- RTK thunks → always add
.rejectedhandler withaddMessages - AbortError → filter out with
if (action.error?.name !== 'AbortError')
Frontend Stream Parsing Pattern
When consuming a migrated streaming endpoint, handle the current NDJSON event format directly:
const data = JSON.parse(line);
if (data.type === 'error') {
const errMsg = data.error?.message || 'Unknown error';
// show to user...
}Backend: Database/Workspace Errors (tables.py)
For table CRUD endpoints, use the specialized classifier:
from data_formulator.routes.tables import classify_and_raise_db_error
@tables_bp.route('/my-table-op', methods=['POST'])
def my_table_op():
try:
result = workspace.do_something()
return jsonify({"status": "success", "data": result})
except Exception as e:
classify_and_raise_db_error(e)classify_and_raise_db_error maps common DB errors to appropriate AppError codes
(returned as HTTP 200 by the global handler, except ACCESS_DENIED → 403):
- "Table does not exist" →
TABLE_NOT_FOUND(HTTP 200) - "Table already exists" →
INVALID_REQUEST(HTTP 200) - "Permission denied" →
ACCESS_DENIED(HTTP 403) - Other →
CONNECTOR_ERROR(HTTP 200)
Backend: Connector Errors (data_connector.py)
For connector endpoints, use:
from data_formulator.data_connector import classify_and_raise_connector_error
except Exception as e:
classify_and_raise_connector_error(e, operation="preview")Connector/DataLoader classification is intentionally simple and lives in
data_formulator.data_loader.connector_errors. It maps common failures to a
small stable set: INVALID_REQUEST, CONNECTOR_AUTH_FAILED, AUTH_EXPIRED,
ACCESS_DENIED, DB_CONNECTION_FAILED, DB_QUERY_ERROR, DATA_LOAD_ERROR,
or CONNECTOR_ERROR. Do not add endpoint-local string matching unless the
classifier cannot reasonably cover the category.
All JSON errors include error.request_id and an X-Request-Id response
header. Show/copy this ID for users when reporting backend failures; do not
show raw exception text in production. Unhandled 500 responses must never
include raw tracebacks, even in debug mode; return a safe category plus
request_id and keep full stack traces in server logs only.
Debugging Error Propagation
When an error isn't reaching the frontend:
- Check backend logs — is the error logged?
- Check response format:
- Non-streaming:
{"status": "error", "error": {"code": ..., "message": ...}} - Streaming: one line
{"type": "error", "error": {"code": ..., "message": ...}}
- Non-streaming:
- Check Content-Type — streaming must be
application/x-ndjson, notapplication/jsonortext/event-stream - Check frontend parser — is the consumer looking for
data.type === 'error'? - Check global handler — verify
register_error_handlers(app)is called inapp.py - Check blueprint handlers — blueprint-level
errorhandler(Exception)takes priority over global handlers
Legacy message / error_message bodies are protocol violations on migrated API paths.
Log Sanitization (Sensitive Data in Server Logs)
Server-side logs must never leak passwords, tokens, API keys, or connection strings. The project uses a defense-in-depth approach with two layers.
Layer 1: Explicit Utilities (call-site)
from data_formulator.security.log_sanitizer import (
sanitize_url, sanitize_params, redact_token,
)
# Dict with credentials → sanitize_params()
log.info("Connecting with: %s", sanitize_params(params))
# URL that may embed credentials → sanitize_url()
logger.info("Issuer: %s", sanitize_url(issuer_url))
# Token/API key → redact_token()
logger.debug("Token: %s", redact_token(token))Layer 2: SensitiveDataFilter (global safety net)
Registered in app.py:configure_logging(). Automatically redacts:
- URL credentials (
://user:pass@host) Bearertokenspassword=xxx,api_key=xxx,secret=xxxpatterns- JWT-like base64 strings
- Python dict repr with sensitive keys
Disable with LOG_SANITIZE=false for local debugging only.
When to Use What
| Data | Utility | Why not just filter? |
dict with password keys | sanitize_params() | Filter can't identify arbitrary password values in dict repr |
| URL from config/env | sanitize_url() | Explicit is clearer; filter is backup |
| Token/key value | redact_token() | Explicit is clearer; filter is backup |
| Normal text | Nothing | Filter handles edge cases |
New Module Checklist
When adding a module that handles credentials or external services:
- Audit all
logger.*()calls for credential/URL/token logging - Use
sanitize_params()for dicts,sanitize_url()for URLs,redact_token()for tokens - Prefer
type(exc).__name__overstr(exc)in warning-level logs - If introducing new credential key names, add to
SENSITIVE_KEYSinlog_sanitizer.py
Key Files
| File | Purpose |
py-src/data_formulator/errors.py | ErrorCode enum + AppError exception |
py-src/data_formulator/error_handler.py | Global handlers, classify_and_wrap_llm_error, stream_error_event |
py-src/data_formulator/security/log_sanitizer.py | sanitize_url, sanitize_params, redact_token, SensitiveDataFilter |
py-src/data_formulator/routes/tables.py | classify_and_raise_db_error (database/workspace errors) |
py-src/data_formulator/data_connector.py | classify_and_raise_connector_error (connector errors) |
py-src/data_formulator/security/sanitize.py | classify_llm_error (internal), sanitize_error_message |
src/app/apiClient.ts | apiRequest, streamRequest, parseStreamLine, ApiRequestError |
src/app/errorHandler.ts | handleApiError |
src/app/errorCodes.ts | ERROR_CODE_I18N_MAP, getErrorMessage |
src/i18n/locales/{en,zh}/errors.json | Error message translations |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

