---
lang: en
title: 'API docs: metadata.decoratorfactory.duplicatedecorationerror'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata
permalink: /doc/en/lb4/apidocs.metadata.decoratorfactory.duplicatedecorationerror.html
---

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

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [DecoratorFactory](./metadata.decoratorfactory.md) &gt; [duplicateDecorationError](./metadata.decoratorfactory.duplicatedecorationerror.md)

## DecoratorFactory.duplicateDecorationError() method

Create an error to report if the decorator is applied to the target more than once

**Signature:**

```typescript
protected duplicateDecorationError(target: Object, member?: string | symbol, descriptorOrIndex?: TypedPropertyDescriptor<any> | number): Error;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

target


</td><td>

Object


</td><td>

Decoration target


</td></tr>
<tr><td>

member


</td><td>

string \| symbol


</td><td>

_(Optional)_ Optional property or method


</td></tr>
<tr><td>

descriptorOrIndex


</td><td>

TypedPropertyDescriptor&lt;any&gt; \| number


</td><td>

_(Optional)_ Optional parameter index or method descriptor


</td></tr>
</tbody></table>
**Returns:**

Error


