Skip to content

Conversation

@Omswastik-11
Copy link

@Omswastik-11 Omswastik-11 commented Dec 29, 2025

Overview

This PR introduces a new OpenMLAuthenticationError exception to clearly distinguish authentication errors (invalid or missing API key) from authorization errors (valid API key without sufficient permissions).


Changes

New Exception

  • Added OpenMLAuthenticationError in exceptions.py

  • Inherits from OpenMLServerError for consistency

  • Automatically appends helpful guidance with links to:

  • Includes a clear docstring explaining the difference between authentication and authorization errors


Updated Error Handling

  • Updated _api_calls.py to:

    • Import and raise OpenMLAuthenticationError for authentication failures

Tests Updated

  • Updated test_authentication_endpoints_requiring_api_key_show_relevant_help_link

    • Now expects OpenMLAuthenticationError instead of OpenMLNotAuthorizedError
    • Continues to assert that helpful guidance is included in the error message

Fixes #1562

@Omswastik-11 Omswastik-11 changed the title [ENH] add openmlauthentication Error exception [ENH] Add OpenMLAuthenticationError for clearer API key error handling Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Add OpenMLAuthenticationError and improve Error Message When API Key is Invalid

1 participant