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

[💡 FEATURE REQUEST]: RPC response error code classification #1179

Open
rauanmayemir opened this issue Jun 15, 2022 · 1 comment
Open

[💡 FEATURE REQUEST]: RPC response error code classification #1179

rauanmayemir opened this issue Jun 15, 2022 · 1 comment
Assignees
Labels
B-Breaking changes Breaking changes C-feature-request Category: feature requested, but need to be discussed

Comments

@rauanmayemir
Copy link

rauanmayemir commented Jun 15, 2022

Plugin

No response

I have an idea!

I have an idea, listen to me!!

The latest direction of RR giving control of the server via RPC commands with protobuf messages is absolutely amazing. In the same spirit, it would be nice to have a way to distinguish response errors. E.g, consider Jobs pipeline creation:

$pipeline = $this->jobs->create(
    new AMQPCreateInfo(
        name: 'pipeline_1',
        prefetch: 1,
        queue: 'queue_1',
        exchange: 'amqp.direct',
        routingKey: 'queue_1',
        multipleAck: false,
        requeueOnFail: false,
    )
);

If the pipeline already exists, JobsInterface will throw JobsException, but on the PHP side, we have no way of knowing whether it's the issue with the already existing pipeline and not e.g RPC failure or something else.

We'd have to look into the exception message which is great for debugging, but not so much for building user-specific workflows around it.

It would help if JobsException also had a code given from RPC. We could also split up exceptions like Jobs\PipelineAlreadyExistsException, but that would still require passing an error code from the RPC.

@rauanmayemir rauanmayemir added the C-feature-request Category: feature requested, but need to be discussed label Jun 15, 2022
@rustatian rustatian moved this to Backlog in General Jun 15, 2022
@rustatian rustatian moved this from Backlog to Todo in General Jun 15, 2022
@rustatian rustatian added the B-Breaking changes Breaking changes label Jul 2, 2022
@rustatian
Copy link
Member

@rauanmayemir Hey 👋🏻
This is a nice feature; however, we can't send an error code, the only error itself for the RPC. Also we can't break an API to send an error code in the return value (avoiding sending the error).

This feature will be nice in the RRv3.

@rustatian rustatian moved this from Todo to Backlog in General Jul 2, 2022
@rustatian rustatian removed this from General Sep 10, 2023
@rustatian rustatian moved this to 📋 Backlog in Jira 😄 Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-Breaking changes Breaking changes C-feature-request Category: feature requested, but need to be discussed
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants