Skip to content

Print the server name on a server exception #445

Closed

Description

@mfeurer

This is the current state which omits this kind of information:

raceback (most recent call last):
  File "/home/travis/build/openml/openml-python/tests/test_runs/test_run_functions.py", line 384, in test_learning_curve_task_1
    random_state_value='62501')
  File "/home/travis/build/openml/openml-python/tests/test_runs/test_run_functions.py", line 117, in _perform_run
    task = openml.tasks.get_task(task_id)
  File "/home/travis/build/openml/openml-python/openml/tasks/functions.py", line 297, in get_task
    raise e
  File "/home/travis/build/openml/openml-python/openml/tasks/functions.py", line 291, in get_task
    dataset = get_dataset(task.dataset_id)
  File "/home/travis/build/openml/openml-python/openml/datasets/functions.py", line 335, in get_dataset
    arff_file = _get_dataset_arff(did_cache_dir, description)
  File "/home/travis/build/openml/openml-python/openml/datasets/functions.py", line 429, in _get_dataset_arff
    arff_string = openml._api_calls._read_url(url)
  File "/home/travis/build/openml/openml-python/openml/_api_calls.py", line 120, in _read_url
    raise _parse_server_exception(response, url=url)
  File "/home/travis/build/openml/openml-python/openml/_api_calls.py", line 135, in _parse_server_exception
    '%d\n' % response.status_code) + response.text)
openml.exceptions.OpenMLServerError: Unexpected server error. Please contact the developers!

Instead it should be like:

openml.exceptions.OpenMLServerError: Unexpected server error on server ???.openml.org. Please contact the developers!

which would help the developer (in this case me who keeps rerunning unit tests) to easily see which server is causing issues.

Activity

  1. janvanrijn commented on Apr 18, 2018

    @janvanrijn
    Member

    This comes from OpenML: `Unexpected server error. Please contact the developers!' You don't want to change this based on a regex.

    Probably you want to preprent or append to all server errors the server address, or add a verbosity option that prints the URL, post vars and exact error, if one occurs

  2. mfeurer commented on Jun 14, 2018

    @mfeurer
    CollaboratorAuthor

    Should be added via #430.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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