> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/docs/pt/acoes/workflow-concepts/workflow-steps/flow/error-step.md).

# Erro

Lance mensagens de erro personalizadas que terminam o workflow

## O que é a Etapa de Erro?

A Etapa de Erro permite-lhe terminar o fluxo de trabalho e apresentar aos utilizadores uma mensagem de erro e um código de erro personalizados.

O erro é composto por duas partes:

1. **Código do erro:** Um identificador personalizado para o erro, que pode ser usado para rastreamento e depuração na API do fluxo de trabalho
2. **Mensagem de erro:** Uma mensagem personalizada apresentada na interface do AirOps, descrevendo o erro com instruções sobre como resolvê-lo.

### Exemplo de caso de utilização

Vamos considerar um cenário em que queremos garantir que a entrada do utilizador não contém qualquer conteúdo sensível. Podemos configurar a Etapa de Erro para lançar o seguinte erro:

1. **Código do erro:** `SENSITIVE_CONTENT_ERROR`
2. **Mensagem de erro:** `A sua entrada contém informações sensíveis. Remova quaisquer dados confidenciais antes de continuar.`

#### Configuração da Etapa de Erro:

<div data-full-width="false"><figure><img src="https://31915162-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX2n5yPRPynbnWuO4SH0M%2Fuploads%2Fgit-blob-bdb8cacb9f40a08ec0b7cf4601ae439d6bd8be63%2FScreenshot%202024-04-26%20at%2013.56.13.png?alt=media" alt="" width="563"><figcaption><p>Configuração do erro</p></figcaption></figure></div>

**Etapa de Erro apresentada ao utilizador:**

<figure><img src="https://31915162-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX2n5yPRPynbnWuO4SH0M%2Fuploads%2Fgit-blob-39309ca4a0c2116f34bacd477f71323af0e25b6f%2FScreenshot%202024-04-26%20at%2013.57.41.png?alt=media" alt="" width="473"><figcaption><p>Mensagem de erro</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/docs/pt/acoes/workflow-concepts/workflow-steps/flow/error-step.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
