|
8 | 8 | from github import Github, GithubException, UnknownObjectException
|
9 | 9 | from github.PullRequest import PullRequest
|
10 | 10 | import os
|
| 11 | +import traceback |
11 | 12 |
|
12 | 13 |
|
13 | 14 | class SequenceStatus(Enum):
|
@@ -501,13 +502,20 @@ def _create_symlink(self, source_path: str, target_path: str, branch: str = None
|
501 | 502 | try:
|
502 | 503 | new_tree = self.git_repo.create_git_tree([tree_element], base_tree)
|
503 | 504 | log_message(LoggingScope.TASK_OPS, 'INFO', "new tree created: %s", new_tree)
|
504 |
| - except Exception as err: |
| 505 | + except GithubException as err: |
505 | 506 | log_message(LoggingScope.TASK_OPS, 'ERROR', "Error creating new tree: %s", err)
|
506 | 507 | log_message(LoggingScope.TASK_OPS, 'ERROR', " Status Code: %s", err.status)
|
507 | 508 | log_message(LoggingScope.TASK_OPS, 'ERROR', " Error Message: %s", err.data)
|
508 | 509 | log_message(LoggingScope.TASK_OPS, 'ERROR', " Headers: %s", err.headers)
|
509 | 510 | log_message(LoggingScope.TASK_OPS, 'ERROR', " Raw Response: %s", err.response)
|
510 | 511 | return False
|
| 512 | + except Exception as err: |
| 513 | + log_message(LoggingScope.TASK_OPS, 'ERROR', "\n=== General Exception ===") |
| 514 | + log_message(LoggingScope.TASK_OPS, 'ERROR', " Type: %s", type(err).__name__) |
| 515 | + log_message(LoggingScope.TASK_OPS, 'ERROR', " Message: %s", str(err)) |
| 516 | + log_message(LoggingScope.TASK_OPS, 'ERROR', " Traceback:") |
| 517 | + log_message(LoggingScope.TASK_OPS, 'ERROR', " %s", traceback.format_exc()) |
| 518 | + return False |
511 | 519 |
|
512 | 520 | # Create new commit
|
513 | 521 | commit_message = f"Add symlink {source_path} -> {target_path}"
|
|
0 commit comments