# appError

Emitted when something unexpected or not allowed happens in the room.

#### Here is a list of the possible error names:

* `permissions-rejected` -> emitted when user tries to screen share, but browser doesn't have enough permissions for it
* `not-allowed` -> emitted when a not allowed action was requested by the user. For example if a user tries to start a recording and recording is not supported in the room, he will receive a `not-allowed` type.
* `forbidden-action` -> emitted when a forbidden action was requested by the user. For example if a user tries to end a session and doesn't have a permission to do so, then the `forbidden-action` type.

#### Sample payload

```json
{
  "type": "appError",
  "data": {
      "name": "not-allowed",
      "message": "Recording disabled. You’ll need to edit this room’s properties to record sessions in this room",
      "data": {
         "type": "recording"
      }
  }
}
```

```json
{
  "type": "appError",
  "data": {
      "name": "forbidden-action",
      "message": "Forbidden action. This participant is not allowed to end session",
      "data": {
         "type": "end-session"
      }
  }
}
```

#### Sample subscription code

```javascript
sambaFrame.on('appError', (error) => {
  console.log(error);

  /* outputs  
    {
      name: 'not-allowed',
      message:
        'Recording disabled. You’ll need to edit this room’s properties to record sessions in this room',
      'data': {
         'type': 'recording'
      }
    }
  */
});
```


---

# Agent Instructions: 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:

```
GET https://docs.digitalsamba.com/reference/sdk/events/apperror.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
