Skip to content

Commit

Permalink
test central erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Sep 27, 2024
1 parent 79fcbc6 commit 5a04f7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 1 addition & 7 deletions llmfoundry/command_utils/data_prep/convert_delta_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,7 @@ def fetch(

if isinstance(e, (AnalysisException, ServerOperationError)):
if 'INSUFFICIENT_PERMISSIONS' in str(e):
match = re.search(r"(?:Table|Schema)\s+'([^']+)'", str(e))
if match:
object_name = match.group(1)
action = f'accessing {object_name}'
else:
action = f'accessing {tablename}'
raise InsufficientPermissionsError(action=action) from e
raise InsufficientPermissionsError(str(e)) from e

if isinstance(e, InsufficientPermissionsError):
raise
Expand Down
5 changes: 2 additions & 3 deletions llmfoundry/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,5 @@ def __init__(
class InsufficientPermissionsError(UserError):
"""Error thrown when the user does not have sufficient permissions."""

def __init__(self, action: str) -> None:
message = f'Insufficient permissions when {action}. Please check your permissions.'
super().__init__(message, action=action)
def __init__(self, message: str) -> None:
super().__init__(message)

0 comments on commit 5a04f7c

Please sign in to comment.