Skip to content

Commit

Permalink
Add relation name to the exception in case of archive failure
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaykiran committed Jan 2, 2019
1 parent 262f093 commit f920c60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dbt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ def missing_config(model, name):


def missing_relation(relation, model=None):
raise_compiler_error(
"Relation {} not found!".format(relation),
model)
base_msg = ('The relation`{relation}` was not found!\n'
'Check that the relation exists, and that your user'
' has permissions to select from this relation.')
raise_compiler_error(base_msg.format(relation=relation), model)


def relation_wrong_type(relation, expected_type, model=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
identifier=target_table) -%}

{%- if source_relation is none -%}
{{ exceptions.missing_relation(source_relation) }}
{%- set source_relation_name = [source_schema, source_table]|join(".") -%}
{{ exceptions.missing_relation(source_relation_name)}}
{%- endif -%}

{%- if target_relation is none -%}
Expand Down

0 comments on commit f920c60

Please sign in to comment.