Skip to content

Internal exception when procedure method not exists #34

@maoxuner

Description

@maoxuner

When calling to a method which procedure doesn't have, it turns out into an internal exception.

local.ERROR: Method App\Http\Procedures\TennisProcedure::pinga() does not exist {"exception":"[object] (ReflectionException(code: 0): Method App\Http\Procedures\TennisProcedure::pinga() does not exist at /app/vendor/sajya/server/src/Guide.php:144)

Procedure Class

<?php
declare(strict_types=1);

namespace App\Http\Procedures;

use Illuminate\Http\Request;
use Sajya\Server\Procedure;

class TennisProcedure extends Procedure
{
    public static string $name = 'tennis';

    public function ping(): string
    {
        return 'pong';
    }
}

Call a method not exists

<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Http;
use Sajya\Client\Client;

class TennisController extends Controller
{
    public function index(): mixed
    {
        $request = Http::withoutVerifying()
            ->baseUrl(route('rpc.endpoint'));
        $client = new Client($request);
        $response = $client->execute('tennis@pinga');
        return $response->result();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions