Skip to content

Improve Error Handling for Invalid Dynatrace URL in Plugin #187

@BanerjeeAgniva

Description

@BanerjeeAgniva

When the Dynatrace plugin is configured with an incorrect or incomplete URL, the plugin throws a vague and misleading error:

❌ Error: Unexpected token '<', "<!DOCTYPE "… is not valid JSON

This occurs because the plugin tries to parse an HTML response (typically a login page or error page) as JSON. This often happens when the API URI is not appended to the Dynatrace URL or authentication fails.

Suggested Improvement

Instead of a generic JSON parsing error, the plugin should:
Detect and handle non-JSON responses.

Show a user-friendly message like:

“The provided Dynatrace URL did not return valid JSON. Please double-check the configured URL and authentication setup.”

Optionally, link to relevant documentation to guide users on the correct format for the Dynatrace API URL.

(Nice-to-have) Validate the configured URL proactively during plugin setup to alert users of potential misconfiguration early.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions