Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2847] Apply more consistent formatting to exception from dbtPlugin.initialize #8152

Closed
MichelleArk opened this issue Jul 19, 2023 · 0 comments · Fixed by #8143
Closed
Assignees

Comments

@MichelleArk
Copy link
Contributor

MichelleArk commented Jul 19, 2023

dbtPlugin.initialize should be used to encapsulate any setup necessary to successfully call hook methods. It should be expected by dbt-core that some error handling is necessary there, and sensible-looking error messages be logged. Currently, any exception from a dbtPlugin.initialize method is pretty verbose and exposes unnecessary details about the plugin method:

❯ dbt run
20:30:47  Running with dbt=1.7.0-a1
20:30:47  target not specified in profile 'postgres', using 'default'
20:30:47  Encountered an error:
Runtime Error
  initialize: Runtime Error
    custom error message

On the other hand, the existing dbt_hooks (get_nodes and get_manifest_artifact) aren't expected to raise exceptions assuming proper initialization - so dbt-core can more aggressively handle exceptions from hooks (at least for now!). So they are fine as-is.

Exit Criteria: exceptions raised by dbtPlugin.initialize should be formatted to look more inline with what a user would expect from a regular user-facing dbt-core exception.

@MichelleArk MichelleArk self-assigned this Jul 19, 2023
@github-actions github-actions bot changed the title Apply more consistent formatting to exception from dbtPlugin.initialize [CT-2847] Apply more consistent formatting to exception from dbtPlugin.initialize Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant