---
url: https://masyaka.github.io/injecute/errors/not-a-function.md
description: call() was used on a service that is not a function
---

# `INJECUTE_NOT_A_FUNCTION`

**call() was used on a service that is not a function.**

## How to fix it

Only function services can be called with call(); use get() for other services.

## Handling it in code

```ts
import { InjecuteError } from 'injecute';

try {
  // ...
} catch (error) {
  if (error instanceof InjecuteError && error.code === 'INJECUTE_NOT_A_FUNCTION') {
    // error.message explains what happened; error.path is the resolution chain
  }
}
```

[All error codes](./index.md)
