laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
942 stars 63 forks source link

Bubble up Exceptions #204

Closed tylernathanreed closed 1 month ago

tylernathanreed commented 1 month ago

I'm trying to troubleshoot my Reverb installation. It's not working, and I don't have any indication as to why.

I started slapping dumps around, and saw that an exception is occurring in React\Socket\SecureServer, but I don't see this exception in any console output or logs.

I tweaked the source code to include a dump:

$this->encryption->enable($connection)->then(
    function ($conn) use ($that): void {
        $that->emit('connection', [$conn]);
    },
    function ($error) use ($that, $connection, $remote): void {
        $error = new RuntimeException(
            'Connection from ' . $remote . ' failed during TLS handshake: ' . $error->getMessage(),
            $error->getCode(),
        );

        dump(compact('error'));

        $that->emit('error', [$error]);
        $connection->close();
    },
);

The dump ultimately came back with a message of:

Connection from tcp://192.168.16.1:41794 failed during TLS handshake: Connection lost during TLS handshake (ECONNRESET)

I'm troubleshooting this error myself, and the error itself is not why I am reporting an issue here. My problem is that Reverb gave me no indication of this error, and I had to go place a dump in a vendor file to discover this.

Is there anything we can do on the Reverb side of things to increase the visibility of these sorts of errors?

driesvints commented 1 month ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

tylernathanreed commented 1 month ago

@driesvints

I'm not trying to troubleshoot the exception here. I'm already on Discord/etc for that.

The point of my issue is that I only discovered this exception by adding a dump inside of vendor code. Reverb gave no indication that there was an issue.

There are scenarios where the tech under the hood for Reverb is throwing exceptions, and Reverb does not bubble up this exception for developers to see. This is the core issue; not the exceptions themselves, but the fact that the exceptions aren't exposed to the developer.

driesvints commented 1 month ago

You seem to be asking for help to get Reverb running. This isn't the right place for that.

If you have a concrete bug with Reverb please open an issue with a filled out issue template.

tylernathanreed commented 1 month ago

@driesvints

I'm asking for Reverb to bubble up exceptions that are thrown under the hood. I'm not trying to troubleshoot my specific circumstance, I'm worried that troubleshooting in general will be harder for anyone using Reverb because of hidden failures behind the scenes.

driesvints commented 1 month ago

@tylernathanreed ah gotcha, sorry I didn't immediately understood that. In that case it's best to just make the PR so @joedixon can review it 👍