Skip to content

Commit

Permalink
vdk-dag: improve error handling and error messages
Browse files Browse the repository at this point in the history
To make it easier to debug VDK DAG jobs some improvements in error
handling are done.
- Stop using deprecated UserCodeError in favour of domain oriented
exceptoin class
- Improve the formatting of the error message in case of failure.

Testing Done: existing tests for regression.
Here is a comparison before and now in the formatting:
https://gist.githubusercontent.com/antoniivanov/8f87cdef1c610fcd24361197bcba45dc/raw/c31b990de2c0b1f49ac5989419cfc6ab12aac934/gistfile1.txt
  • Loading branch information
antoniivanov committed Feb 25, 2024
1 parent 81345a2 commit 1048644
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions projects/vdk-plugins/vdk-dag/src/vdk/plugin/dag/exception.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Copyright 2023-2024 Broadcom
# SPDX-License-Identifier: Apache-2.0

# Copyright 2021-2024 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import json
from typing import Any
from typing import List
from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion projects/vdk-plugins/vdk-dag/tests/test_local_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def reduce_retries_in_test_http_requests():
with mock.patch.dict(
os.environ,
{
"DAG_LOCAL_RUN_JOB_PATH": jobs_path_from_caller_directory(""),
"DAGS_LOCAL_RUN_JOB_PATH": jobs_path_from_caller_directory(""),
"DAGS_DAG_EXECUTION_CHECK_TIME_PERIOD_SECONDS": "0",
"DAGS_TIME_BETWEEN_STATUS_CHECK_SECONDS": "0",
},
Expand Down

0 comments on commit 1048644

Please sign in to comment.