Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Editor load errors display raw exception text to users

未关闭
#604 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
android, ios, kotlin, swift
领域
frontend, mobile

调研方向

从 ios/Sources/GutenbergKit/Sources/EditorViewController.swift 中的 displayError 以及 android/Gutenberg/src/main/java/org/wordpress/gutenberg/GutenbergView.kt 中的 EditorErrorView/showErrorPhase 开始。检查 EditorHttpClient.kt 的第 85–88 行,以及它与 #603 中提议的类型化 EditorLoadFailure 之间的关系。完成的标准是两个平台都显示适合用户的 auth 或可重试消息,同时原始详细信息仍可用于日志和遥测。

由索引模型根据 Issue 内容生成。

描述

[Type] Bug Android iOS

Description

When the editor fails to load, both platforms render the underlying exception message directly in the library's error view. These strings are written for developers, and they reach users of both production apps.

Examples seen in testing:

  • iOS: No route was found matching the URL and request method.
  • Android: rest_no_route: No route was found matching the URL and request method.
  • Android: Unknown error with status code: 500
  • Android: Failed to load editor; unable to resolve host…

Android additionally prefixes the machine-readable WP error code, because WPErrorResponse.message is built as "${error.code}: ${error.message}" (EditorHttpClient.kt#L85-L88).

This is not demo-only

The error views live in the library, and neither host app can override them:

  • iOS: displayError renders error.localizedDescription (EditorViewController.swift#L1015-L1025). didFailToLoad is documented as firing after the error is displayed, and WP-iOS's implementation is analytics-only.
  • Android: GutenbergView owns EditorErrorView and calls showErrorPhase directly (GutenbergView.kt#L373-L384). WP-Android embeds GutenbergView and inherits the view as-is.

Proposed change

  • Map failure classes to user-appropriate copy rather than echoing exception text
  • Auth failures: something actionable, e.g. "Sign in again to continue editing"
  • Server/network failures: a generic retryable message
  • Keep the raw error for logs and telemetry, not the UI
  • Android: stop prefixing the WP error code in user-visible text
  • Consider a retry affordance where the failure is retryable

Notes

  • #602 removes the rest_no_route message from this view entirely, and #603 removes most transient 5xx cases under automatic fallback. What remains — auth failures, and everything under disabled fallback — still needs real copy, so this is worth doing independently and is lower priority than both.
  • Pairs naturally with the typed EditorLoadFailure proposed in #603: the classification that drives host behavior can also drive the message.
主要语言
JavaScript
星标
29
派生
7
平均合并
3 天 6 小时
30 天内合并 PR
92

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wordpress-mobile/GutenbergKit 的其他 Issue

查看 wordpress-mobile/GutenbergKit 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。