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

DOC-964 New bloblang error functions #151

Merged
merged 9 commits into from
Feb 6, 2025
Merged
Changes from 4 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
34 changes: 32 additions & 2 deletions modules/guides/pages/bloblang/functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ root.doc = content().string()

=== `error`

If an error has occurred during the processing of a message this function returns the reported cause of the error as a string, otherwise `null`. For more information about error handling patterns read xref:configuration:error_handling.adoc[].
If an error occurs during the processing of a message, this function returns the reported cause as a string, otherwise `null`. For more information about error-handling patterns, see xref:configuration:error_handling.adoc[].

==== Examples

Expand All @@ -383,9 +383,39 @@ If an error has occurred during the processing of a message this function return
root.doc.error = error()
```

=== `error_source_label`

Returns the label of the component that raised the error during the processing of a message, or an empty string if not set. A `null` is returned when the error is null or no component is associated with the source of the error. For more information about error-handling patterns, see xref:configuration:error_handling.adoc[].

==== Examples

```coffeescript
root.doc.error_source_label = error_source_label()
```

=== `error_source_name`

Returns the name of the component that raised the error during the processing of a message. A `null` is returned when the error is null or no component is associated with the source of the error. For more information about error-handling patterns, see xref:configuration:error_handling.adoc[].

==== Examples

```coffeescript
root.doc.error_source_name = error_source_name()
```

=== `error_source_path`

Returns the path of the component that raised the error during the processing of a message. A `null` is returned when the error is null or no component is associated with source of the error. For more information about error-handling patterns, see xref:configuration:error_handling.adoc[].

==== Examples

```coffeescript
root.doc.error_source_path = error_source_path()
```

=== `errored`

Returns a boolean value indicating whether an error has occurred during the processing of a message. For more information about error handling patterns read xref:configuration:error_handling.adoc[].
Returns a boolean value indicating whether an error has occurred during the processing of a message. For more information about error-handling patterns, see xref:configuration:error_handling.adoc[].

==== Examples

Expand Down