Skip to content

Improve Error Messaging When Generating Models for the Delivery SDK #197

@mjstackhouse

Description

@mjstackhouse

Motivation

Utilizing the more specific error messaging from the Delivery API response would improve the user experience and ability to pinpoint the issue with the command being used. The current error messaging used for issues such as an invalid environment ID, invalid/missing API key, and no content types existing in the specified environment all utilize the same general error that says, "No content type available for the environment (). Check the environment and project settings at https://app.kontent.ai/," which doesn't indicate to the user what the actual issue is in the case of an invalid environment ID, invalid API key, or missing API key.

For example, the command shown below uses an invalid environment ID, but the current messaging does not indicate that:
Image

Proposed solution

Utilize the existing error messaging that's already returned from the Delivery API response (although, an error like, "Missing or invalid access token. Please include the valid access token value in the Authorization header field as an HTTP bearer authorization scheme," would likely need to be handled and customized individually to avoid the second sentence causing confusion).

I already tested some adjustments, so, as per my previous example, the improved messaging for an invalid environment ID would be something like this:
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