Skip to content

Improve error messages #795

@MichaelGrafnetter

Description

@MichaelGrafnetter

Describe the feature request?

When the client is not assigned proper OAuth scopes, the error messages are not helpful at all. Example:

User[] users = await userApi.ListUsers().ToArrayAsync();

The resulting Okta.Sdk.Client.ApiException message is typically "Error calling OktaPagedCollectionEnumerator:".

A more helpful message would be "Error fetching users: Missing okta.users.read scope authorization." or something similar. The exception could even be translated to a native .NET exception, e.g., System.UnauthorizedAccessException, with the API exception stored in the InnerException property.

New or Affected Resource(s)

Okta.Sdk.Client.ApiException

Provide a documentation link

No response

Additional Information?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions