# Class: UserVisibleError

Defined in: [api.ts:88](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api.ts#L88)

An error whose message will be shown to the end user in the UI when it occurs. If an error is encountered in a formula and you want to describe the error to the end user, throw a UserVisibleError with a user-friendly message and the Coda UI will display the message.

## Example

```
if (!url.startsWith("https://")) {
  throw new sdk.UserVisibleError("Please provide a valid url.");
}
```

## See

- [Handling errors - User-visible errors](https://head.coda.io/packs/build/latest/guides/advanced/errors/#user-visible-errors)

## Extends

- `Error`

## Constructors

### Constructor

> **new UserVisibleError**(`message?`, `internalError?`): `UserVisibleError`

Defined in: [api.ts:97](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api.ts#L97)

Use to construct a user-visible error.

#### Parameters

| Parameter | Type | | --- | --- | | `message?` | `string` | | `internalError?` | `Error` |

#### Returns

`UserVisibleError`

#### Overrides

`Error.constructor`
