Skip to content

Commit

Permalink
[#56987] pipeline_manager: rpc_handler: Added more detailed error mes…
Browse files Browse the repository at this point in the history
…sages

Signed-off-by: Grzegorz Latosinski <[email protected]>
  • Loading branch information
glatosinski committed Apr 8, 2024
1 parent 74e892a commit d0d3a17
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions kenning/pipeline_manager/rpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import asyncio
import datetime
import json
import traceback
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict
Expand Down Expand Up @@ -121,7 +122,9 @@ async def dataflow_import(
):
KLogger.warning("Cancelling import job")
except (ValidationError, RuntimeError) as ex:
KLogger.error(f"Failed to load JSON file:\n{ex}")
KLogger.error(
f"Failed to load JSON file:\n{traceback.format_exc()}"
)
return {
"type": MessageType.ERROR.value,
"content": f"Failed to load scenario:\n{ex}", # noqa: E501
Expand Down Expand Up @@ -182,7 +185,9 @@ async def dataflow_export(self, dataflow: Dict) -> Dict:
):
KLogger.warning("Cancelling export job")
except (ValidationError, RuntimeError) as ex:
KLogger.error(f"Failed to save the scenario:\n{ex}")
KLogger.error(
f"Failed to save the scenario:\n{traceback.format_exc()}"
)
return {
"type": MessageType.ERROR.value,
"content": f"Failed to save the scenario:\n{ex}", # noqa: E501
Expand Down Expand Up @@ -222,7 +227,9 @@ async def specification_get(self) -> Dict:
):
KLogger.warning("Cancelling specification building")
except (ValidationError, RuntimeError) as ex:
KLogger.error(f"Failed to generate specification:\n{ex}")
KLogger.error(
f"Failed to generate specification:\n{traceback.format_exc()}"
)
return {
"type": MessageType.ERROR.value,
"content": f"Failed to generate specification:\n{ex}", # noqa: E501
Expand Down Expand Up @@ -288,7 +295,7 @@ async def dataflow_validate(self, dataflow: Dict) -> Dict:
):
KLogger.warning("Cancelling validate job")
except (ValidationError, RuntimeError) as ex:
KLogger.error(f"Validation error:\n{ex}")
KLogger.error(f"Validation error:\n{traceback.format_exc()}")
return {
"type": MessageType.ERROR.value,
"content": f"Validation error:\n{ex}", # noqa: E501
Expand Down Expand Up @@ -376,7 +383,9 @@ def dataflow_runner(runner):
):
KLogger.warning("Cancelling run job")
except (ValidationError, RuntimeError) as ex:
KLogger.error(f"Failed to run the pipeline:\n{ex}")
KLogger.error(
f"Failed to run the pipeline:\n{traceback.format_exc()}"
)
return {
"type": MessageType.ERROR.value,
"content": f"Failed to run the pipeline:\n{ex}", # noqa: E501
Expand Down Expand Up @@ -468,7 +477,7 @@ def dataflow_optimizer(runner):
):
KLogger.warning("Cancelling optimizing job")
except Exception as ex:
KLogger.error(f"Optimizing error:\n{ex}")
KLogger.error(f"Optimizing error:\n{traceback.format_exc()}")
return {
"type": MessageType.ERROR.value,
"content": f"Optimizing error:\n{ex}",
Expand Down Expand Up @@ -554,7 +563,7 @@ async def custom_dataflow_report(self, dataflow: Dict) -> Dict:
):
KLogger.warning("Cancelling reporting job")
except Exception as ex:
KLogger.error(f"Reporting error:\n{ex}")
KLogger.error(f"Reporting error:\n{traceback.format_exc()}")
return {
"type": MessageType.ERROR.value,
"content": f"Reporting error:\n{ex}",
Expand Down

0 comments on commit d0d3a17

Please sign in to comment.