From 689990b5ac3b07d56cb39c6bbc773e60ee632ca9 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 5 Nov 2021 16:21:43 +0100 Subject: [PATCH 1/2] more general message returned --- cdci_data_analysis/analysis/instrument.py | 2 +- cdci_data_analysis/analysis/queries.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cdci_data_analysis/analysis/instrument.py b/cdci_data_analysis/analysis/instrument.py index 21638838a..30ca75ff7 100644 --- a/cdci_data_analysis/analysis/instrument.py +++ b/cdci_data_analysis/analysis/instrument.py @@ -304,7 +304,7 @@ def run_query(self, product_type, else: e_message = ('Your request produced an unusual result. It might not be what you expected. ' 'It is possible that this particular parameter selection should indeed lead to this outcome ' - '(e.g. there is no usable data). Please look carefully on your request.\n' + '(e.g. there is no usable data). Please look carefully on your request.\n\n' 'It is also possible that the platform experienced a temporary issue. ' 'We aim at distinguishing all of such issues and report them clearly, ' 'but for now, we unfortunately can not be certain all cases like this are detected. ' diff --git a/cdci_data_analysis/analysis/queries.py b/cdci_data_analysis/analysis/queries.py index 6b34e905a..1dee26614 100644 --- a/cdci_data_analysis/analysis/queries.py +++ b/cdci_data_analysis/analysis/queries.py @@ -393,7 +393,7 @@ def test_communication(self, instrument, query_type='Real', logger=None, config= debug_message=debug_message) except Exception as e: - raise InternalError() + raise InternalError(None) status = query_out.get_status() msg_str = '--> data server communication status: %d' %status From 80d6ea834c43a06c5e934d88de8c924393df1b02 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 5 Nov 2021 18:43:32 +0100 Subject: [PATCH 2/2] forgotten last commit --- cdci_data_analysis/analysis/instrument.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cdci_data_analysis/analysis/instrument.py b/cdci_data_analysis/analysis/instrument.py index 30ca75ff7..a58c3bfbf 100644 --- a/cdci_data_analysis/analysis/instrument.py +++ b/cdci_data_analysis/analysis/instrument.py @@ -300,9 +300,9 @@ def run_query(self, product_type, raise except InternalError as e: if hasattr(e, 'message') and e.message is not None: - e_message = e.message + message = e.message else: - e_message = ('Your request produced an unusual result. It might not be what you expected. ' + message = ('Your request produced an unusual result. It might not be what you expected. ' 'It is possible that this particular parameter selection should indeed lead to this outcome ' '(e.g. there is no usable data). Please look carefully on your request.\n\n' 'It is also possible that the platform experienced a temporary issue. ' @@ -310,9 +310,12 @@ def run_query(self, product_type, 'but for now, we unfortunately can not be certain all cases like this are detected. ' 'We try to discover on our own and directly address any temporary issue. ' 'But some issues might slip past us. If you are willing to help us, ' - 'please use "provide feedback" button below. We would greatly appreciate it!' + 'please use "provide feedback" button below. We would greatly appreciate it!\n\n' + 'This additional information might help:\n\n' ) + e_message = f'Instrument: {self.name}, product: {product_type} failed!\n' query_out.set_failed(product_type, + message=message, e_message=e_message, logger=logger, sentry_client=sentry_client,