unopim/unopim · error · ModelNotFoundException

Channel with code %s could not be found.

Error message

Channel with code %s could not be found.

What it means

Error "Channel with code %s could not be found." thrown in unopim/unopim.

Source

Thrown at packages/Webkul/AdminApi/src/ApiDataSource/ChannelDataSource.php:79

    public function getByCode(string $code)
    {
        $this->prepareForSingleData();

        $requestedFilters = [
            'code' => [
                [
                    'operator' => '=',
                    'value'    => $code,
                ],
            ],
        ];

        $this->queryBuilder = $this->processRequestedFilters($requestedFilters);

        $channel = $this->queryBuilder->first()?->toArray();

        if (! $channel) {
            throw new ModelNotFoundException(
                sprintf('Channel with code %s could not be found.', (string) $code)
            );
        }

        return [
            'code'          => $channel['code'],
            'labels'        => $this->getTranslations($channel),
            'root_category' => $channel['root_category'] ? $channel['root_category']['code'] : null,
            'locales'       => $this->getLocales($channel),
            'currencies'    => $this->getCurrencies($channel),
        ];
    }

    /**
     * Get locales of the channel.
     *
     * @param  array  $channel  The channel data from the database.
     * @return array An array of locales associated with the channel.

View on GitHub (pinned to c27a402253)

When it happens

Trigger: Thrown at packages/Webkul/AdminApi/src/ApiDataSource/ChannelDataSource.php:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of unopim/unopim@c27a402253 (2026-08-21). Data as JSON: /api/errors/2f422563e5e5f3b7. Report an issue: GitHub.