Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal exception when procedure method not exists #34

Closed
maoxuner opened this issue Jul 11, 2022 · 2 comments
Closed

Internal exception when procedure method not exists #34

maoxuner opened this issue Jul 11, 2022 · 2 comments

Comments

@maoxuner
Copy link

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();
    }
}
tabuna added a commit that referenced this issue Jul 12, 2022
@tabuna
Copy link
Member

tabuna commented Jul 12, 2022

Hi @pawmaster This should be fixed with the release of version 5.0.3

@maoxuner
Copy link
Author

@tabuna It works. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants