Skip to content

Commit

Permalink
revert error type (#162)
Browse files Browse the repository at this point in the history
* revert error type

* qa
  • Loading branch information
francesconazzaro authored Jun 14, 2024
1 parent 98fdafd commit e6b0ba9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions cads_adaptors/adaptors/mars.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
from typing import Any, BinaryIO, Union

from cads_adaptors import exceptions
from cads_adaptors.adaptors import Context, Request, cds
from cads_adaptors.tools import adaptor_tools
from cads_adaptors.tools.date_tools import implement_embargo
Expand Down Expand Up @@ -127,7 +126,7 @@ def execute_mars(
context.add_user_visible_error(
message=error_message,
)
raise exceptions.InvalidRequest(error_message)
raise RuntimeError(error_message)

return target

Expand Down
4 changes: 2 additions & 2 deletions cads_adaptors/adaptors/multi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from copy import deepcopy
from typing import Any

from cads_adaptors import AbstractCdsAdaptor, exceptions, mapping
from cads_adaptors import AbstractCdsAdaptor, mapping
from cads_adaptors.adaptors import Request
from cads_adaptors.tools.general import ensure_list

Expand Down Expand Up @@ -108,7 +108,7 @@ def retrieve(self, request: Request):
results += this_result

if len(results) == 0:
raise exceptions.InvalidRequest(
raise RuntimeError(
"MultiAdaptor returned no results, the error logs of the sub-adaptors is as follows:\n"
f"{exception_logs}"
)
Expand Down
2 changes: 1 addition & 1 deletion cads_adaptors/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def legacy_intersect_constraints(
f" in the web-portal, your request:\n {request}\n"
"If you believe this to be a data store error, please contact user support.\n"
)
raise exceptions.InvalidRequest(
raise RuntimeError(
"Request has not produce a valid combination of values, please check your selection.\n"
f"{request}"
)
Expand Down
3 changes: 1 addition & 2 deletions cads_adaptors/tools/url_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import yaml
from tqdm import tqdm

from cads_adaptors import exceptions
from cads_adaptors.adaptors import Context
from cads_adaptors.tools import hcube_tools

Expand Down Expand Up @@ -65,7 +64,7 @@ def try_download(urls: List[str], context: Context, **kwargs) -> List[str]:
"Your request has not found any data, please check your selection.\n"
"If you believe this to be a data store error, please contact user support."
)
raise exceptions.InvalidRequest(
raise RuntimeError(
f"Request empty. No data found from the following URLs:"
f"\n{yaml.safe_dump(urls, indent=2)} "
)
Expand Down

0 comments on commit e6b0ba9

Please sign in to comment.