Skip to content

MarkdownRenderer WebView swallows render errors silently #22

@jim-daf

Description

@jim-daf

Summary

The WebViewClient in app/src/main/java/ch/tiim/markdown_widget/MarkdownRenderer.kt overrides onPageFinished but does not override onReceivedError. When the widget hits an error during the WebView render step (for example a malformed HTML payload from the parser, or a resource the rendered markdown references that fails to load), onPageFinished still fires, the bitmap gets drawn from a half-loaded WebView, and the widget shows a blank or partially rendered tile with nothing in logcat to point at the cause.

Proposal

Add a minimal onReceivedError(view, request, error) override that logs the error code, description and failing URL with Log.w(TAG, ...), filtered to main-frame requests so subresource failures inside the rendered markdown do not flood logcat. Logging only, no UI change, no behavior change in the happy path.

The new API 23+ (WebView, WebResourceRequest, WebResourceError) signature is used because minSdk is 24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions