---
lang: en
title: 'API docs: rest.restserver._onunhandlederror'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.rest.restserver._onunhandlederror.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [RestServer](./rest.restserver.md) &gt; [\_onUnhandledError](./rest.restserver._onunhandlederror.md)

## RestServer.\_onUnhandledError() method

<b>Signature:</b>

```typescript
protected _onUnhandledError(req: Request, res: Response, err: Error): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  req | <code>Request</code> |  |
|  res | <code>Response</code> |  |
|  err | <code>Error</code> |  |

<b>Returns:</b>

`void`


