Commit b43690c0 authored by Martin Atkins's avatar Martin Atkins
Browse files

tfdiags: Simple helper for creating "sourceless" diagnostics

While diagnostics are primarily designed for reporting problems in
configuration, they can also be used for errors and warnings about the
environment Terraform is running in, such as inability to reach a remote
service, etc.

Function Sourceless makes it easy to produce such diagnostics with the
customary summary/detail structure. When these diagnostics are rendered
they will have no source code snippet and will instead just include the
English-language content.
No related merge requests found
Showing with 13 additions and 0 deletions
+13 -0
package tfdiags
// Sourceless creates and returns a diagnostic with no source location
// information. This is generally used for operational-type errors that are
// caused by or relate to the environment where Terraform is running rather
// than to the provided configuration.
func Sourceless(severity Severity, summary, detail string) Diagnostic {
return diagnosticBase{
severity: severity,
summary: summary,
detail: detail,
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment