Memco

Class MemcoUserAlreadyAssignedNetworkError

The user is already in another network of the same memory domain.

A user is placed in one network per domain, so placing them in a second is refused rather than done as a silent move. Pass force: true to NetworkOperations.addMember to move them.

try {
await client.networks.addMember(project.id, { userId: user.id })
} catch (error) {
if (!(error instanceof MemcoUserAlreadyAssignedNetworkError)) throw error
console.log(`moving them out of ${error.currentNetworkName}`)
await client.networks.addMember(project.id, { userId: user.id, force: true })
}

Hierarchy (View Summary)

Index
code: Status

The gRPC status code, as @grpc/grpc-js's numeric status enum.

codeName: string

The status code's name, such as UNAUTHENTICATED.

detail: string

The service's own description of the failure, without the code prefix.

debugErrorString: string | undefined

gRPC's internal diagnostic string, when the call carried one.

metadata: Readonly<Record<string, string>>

The detail the service attached to the refusal, key to value, such as the network a user is already in. Empty when it attached none. Frozen, and the service's to extend: a key this SDK does not name is still here.

reason: "USER_ALREADY_ASSIGNED_NETWORK" = 'USER_ALREADY_ASSIGNED_NETWORK'

The reason the service names this refusal by.

currentNetworkId: string | null

The id of the network the user is already in, or null if unsent.

currentNetworkName: string | null

The name of the network the user is already in, or null if unsent.

On this page