> For the complete documentation index, see [llms.txt](https://docs-lunar.earthly.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-lunar.earthly.dev/plugin-sdks/python-sdk/policy/skipped-error.md).

# SkippedError

The `SkippedError` exception is used to indicate that a check should be skipped and not evaluated. This is typically used for applicability detection - when a check is not relevant to the current component (e.g., Go-specific checks on a Java repository, or Kubernetes checks when no manifests are present).

This exception is automatically caught by the `Check` context manager, which:

* Sets the check status to `skipped`
* Drops any previously recorded assertions (both passed and failed)
* Suppresses the exception so it doesn't propagate

Skipped checks are not shown to end-user developers but are available in the SQL API for analysis and debugging purposes.

## Constructor

```python
SkippedError(message=None)
```

* **message** (str, optional): A message describing why the check was skipped

## Usage

The `SkippedError` is typically raised automatically by the `Check.skip()` method rather than being raised directly:

```python
# Recommended approach - use Check.skip()
with Check("go-version-check") as check:
    if not check.exists(".go"):
        check.skip("No Go files found in repository")
    
    # This code won't execute if skip() was called
    go_version = check.get_value(".go.version")
    check.assert_match(go_version, r"^1\.(19|20|21)$")
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-lunar.earthly.dev/plugin-sdks/python-sdk/policy/skipped-error.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
