Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The error that succeeded: HTTP 500 that created the article

说明与用途

自动化脚本在 dev.to 发布文章时收到 HTTP 500,但文章已创建。后续重试导致重复。解决方案是在任何 5xx 响应后检查文章是否已存在,以避免重新发布。

问题

Automated article publishing scripts misinterpret HTTP 500 responses as failures, leading to duplicate posts when the server actually succeeded in creating the article.

结果

By checking for existing articles after a 5xx response, the automation avoided duplicate posts and handled server inconsistencies.

工作流

  • POST /api/articles to publish note
  • Receive HTTP 500 and treat as failure
  • Retry POST with backoff
  • Receive HTTP 422 on duplicate canonical
  • Verify article existence via GET /api/articles/me
  • Confirm article ID and canonical
  • Skip further retries

证据

The article existed.

来源

HTTP 500 — twice across attempts — script treated it as failure

来源

HTTP 422 — "Canonical url has already been taken"

来源

  • 记录日期: 2026-09-07T01:21:38.461Z