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

Fix documentation url for 'can()' and 'try()' #13022

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ whether the expression produced a result without any errors.

This is a special function that is able to catch errors produced when evaluating
its argument. For most situations where you could use `can` it's better to use
[`try`](/packer/docs/templates/hcl_templates/functions/conversion/try) instead, because it allows for more concise definition of
[`try`](/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx) instead, because it allows for more concise definition of
fallback values for failing expressions.

The `can` function can only catch and handle _dynamic_ errors resulting from
Expand All @@ -24,7 +24,7 @@ as a malformed resource reference.
variable validation rules. Although it can technically accept any sort of
expression and be used elsewhere in the configuration, we recommend against
using it in other contexts. For error handling elsewhere in the configuration,
prefer to use [`try`](/packer/docs/templates/hcl_templates/functions/conversion/try).
prefer to use [`try`](/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx).

## Examples

Expand Down Expand Up @@ -53,5 +53,5 @@ A local value with the name "nonexist" has not been declared.

## Related Functions

- [`try`](/packer/docs/templates/hcl_templates/functions/conversion/try), which tries evaluating a sequence of expressions and
- [`try`](/website/content/docs/templates/hcl_templates/functions/conversion/try.mdx), which tries evaluating a sequence of expressions and
returns the result of the first one that succeeds.
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ A local value with the name "nonexist" has not been declared.

## Related Functions

- [`can`](/packer/docs/templates/hcl_templates/functions/conversion/can), which tries evaluating an expression and returns a
- [`can`](/website/content/docs/templates/hcl_templates/functions/conversion/can.mdx), which tries evaluating an expression and returns a
boolean value indicating whether it succeeded.