---
title: mapAndLogError
summary: Calls mapError and outputs the results to stderr.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/experimental/fn.mapAndLogError/
---

**Kind:** Function  
**Module:** [experimental](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/experimental/)  
**Package:** @fastly/js-compute 4.0.1  
**Since:** 3.37.0  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/experimental.d.ts#L111

```javascript
mapAndLogError(error: Error | string): void
```

Calls [mapError](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/experimental/fn.mapError/) and outputs the results to stderr.

**Parameters**

- `error`: `Error | string`

  The error to map and log. If a string is provided, it is
    first converted to an `Error`.

**Returns**

`void`
